Results 1 to 4 of 4

Thread: Client / Server & UDP

  1. #1

    Thread Starter
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159

    Client / Server & UDP

    Hi,

    I am trying to write a simple Client/ Server application. I am using a TcpListener, and a TcpClient with a NetworkStream. I have got as far as connecting a single client to a server app, and my server can read data sent from the client. However, I want my server to send something back to acknowledge the connection - I am confused. Do I need a separate UDP connection or is the fact that a connection has already been established enough? At the client end I am creating a socket to send the data to the server - it keeps on falling over when I try to create a listener socket at the client end waiting for a response.

    Can somebody point me to a simple echo style application or something that will help me?

    I would be most grateful,

    Thanks,
    DJ

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i didnt understand quite all ur question but i am facing a problem in my client/server tcp application..when the server sends data to the client it disconnects.. anyone knows why? was that what u mean?
    \m/\m/

  3. #3
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    When you accept the connection on the server, you can do it like so...
    Code:
    TcpClient talkBack = myTcpListener.AcceptTcpClient();
    now you have a new TcpClient which can send data from the server to your client the same way your client does. Good luck!
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    didnt anyone experience what happened to me? if no maybe its the class i used its stupid..could u share it with me?

    tks..
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width