Search:

Type: Posts; User: Bob M

Page 1 of 2 1 2

Search: Search took 0.13 seconds.

  1. socket connection - moving from a single client to multiple clients

    I have a socket connection: server - single client working fine

    I wish to add some extra clients

    Each client runs on a separate PC on the same network

    All PCs have a large similar java main...
  2. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    the stack trace needs to be read from the bottom upwards - see the time stamps
  3. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Norm

    The first line is NOT missing

    there is no variable on line 1720

    that line is

    server.start();
  4. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Here is the full stack trace

    2019-06-18 23:00:03 at java.lang.Thread.run(Unknown Source)
    2019-06-18 23:00:03 at...
  5. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    In the calling code on the Client computer (No.2)
    do I need to replace "localhost" with the IP address of Computer 1 ?

    Bob M

    p.s. have just replaced an ethernet cable - now both computers are...
  6. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    I do not understand you...........

    Both PC's are local ?

    Does the calling code on the Client side look OK ?
  7. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Client error: (hourly)
    SocketClient exception occurred: java.net.ConnectException: Connection refused: connect
  8. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    My understanding is that if a message was successfully received by Computer 1, then the socket would be closed

    Thus my prime problem is:- why does the code on Computer 2 (client) not send a...
  9. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    yes - because my main java program operates on an hourly basis and it is NOT receiving a message from Computer 2

    I probably have errors in the code on both sides at the moment but one main problem...
  10. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Hi

    I have the following code (in my main java programs - which activate every hour on the hour)

    Computer 2: (Client)
    Calling code:-

    // send a message to Computer 1 with your trading...
  11. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    hi again

    I am now going with a non-static solution as follows.........


    import java.io.*;
    import java.net.*;

    public class SocketClient {
  12. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    can you show me an example of what you are meaning please ?
  13. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    I spoke too soon....................

    Clean compile on Socket Server code but

    1 compile error on the Socket Client code

    reference to Trading_Decision_2

    error] cannot make a static...
  14. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    I am logged on to Dukascopy's Trading platform where one runs java programs

    I have removed () and get a clean compile

    Sorry for my bad.........

    thank you very much :)

    Bob M
    New Zealand
  15. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Incorporate = add server code (cut and paste) as a subroutine in my large java program and call it when required - on Computer 1

    Add client code (cut and paste) as a subroutine in my large java...
  16. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Incorporate = add server code (cut and paste) as a subroutine in my large java program and call it when required - on Computer 1

    Add client code (cut and paste) as a subroutine in my large java...
  17. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    the stand-alone example works

    it is when I try to incorporate it into my large java program that i have problems
  18. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    questions:-......................

    Is that main in a nested class (you asked)
    Does it appear to be in the code I posted ?

    Make the class static (you advised)
    I added the word 'static' - is...
  19. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    will do.....

    Bob M
  20. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    Hi

    have done that and now on compilation I get 2 problems on amended line

    public static class SocketServer() {

    Error 1] Syntax error on token "class", @ expected
    Error 2] Syntax error,...
  21. Replies
    40
    Views
    2,996

    Re: simple soclet communication between 2 PCs

    yes - compilation errors

    3 problems (3 errors)
    2019-06-06 15:26:00 ---------- ...
  22. Replies
    40
    Views
    2,996

    simple soclet communication between 2 PCs

    Hi

    I have the following code which runs successfully as a stand alone example

    when I try to incorporate it into my java program I get an error message

    Error message (on Server): Cannot make...
  23. Replies
    15
    Views
    1,550

    Re: Help in recoding more efficiently

    In a word - No!

    The first iteration (time interval) is perfect
    Thereafter it is all wrong

    p.s. normally I wouldn't worry about repeating code over and over but the classifier LibSVM has a...
  24. Replies
    15
    Views
    1,550

    Re: Help in recoding more efficiently

    Initially, the 'fc' forms part of the once-only code and so is encapsulated within this code
    But I am using fc..... outside this {}

    I therefore took the fc definition line out of the once-only...
  25. Replies
    15
    Views
    1,550

    Re: Help in recoding more efficiently

    hi Norm

    When I encapsulate the red code in a once-only loop I run into problems............

    the very next line of code is fc.buildClassifier(training);

    but the 'fc' no longer is in scope ???...
Results 1 to 25 of 29
Page 1 of 2 1 2