Socket communication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ronnin.ubrasky@gmail.com

    Socket communication

    Hi all,
    I am having two programs that should communicate using sockets.
    Program A [has some import data on port 2121] it sends some bytes to
    ProgramB.
    The programB then process them and send back to A[on port 1234.

    The problem is that,when I start program A it gives an error that it
    cannot connect to port 2121.
    But then if start programB it says that it cannot connect to port
    1234..

    How can I solve this issue
  • ppi

    #2
    Re: Socket communication

    On Feb 19, 6:24 pm, ronnin.ubra...@ gmail.com wrote:
    Hi all,
    I am having two programs that should communicate using sockets.
    Program A [has some import data on port 2121] it sends some bytes to
    ProgramB.
    The programB then process them and send back to A[on port 1234.
    >
    The problem is that,when I start program A it gives an error that it
    cannot connect to port 2121.
    But then if start programB it says that it cannot connect to port
    1234..
    >
    How can I solve this issue
    Sockets are not part of the c++ language, what API/library are u
    using ?
    if you are using plain BSD/POSIX sockets, you should ask in
    comp.unix.progr ammer.
    what sockets are you using, UDP, TCP, UNIX ?
    Attach some code ...

    cheers,
    paulo

    Comment

    • ronnin.ubrasky@gmail.com

      #3
      Re: Socket communication

      Hi Paulo,
      These are 2 tcp sockets.

      I think that whole issue is the server and client problem.
      programA expects a server to accept clients on 2121 and programb
      expects a server on 1234.

      But I cannot start neither one at first because program A is dependent
      on program B and program B is dependent on A.

      How can I solve this.I am sure that there is way around this.

      Comment

      Working...