-
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
-
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? :confused: was that what u mean?
-
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!
-
didnt anyone experience what happened to me? if no maybe its the class i used its stupid..could u share it with me?
tks..