winsock connect problem
-
I met a problem. I have a server and a client. Client connect to server. It works and client can send message to server. But how can I send message from server to client? I try to let server connect to client, but it says it already connected. How could I let server send message to client,too? Can somebody give me an example? Thanks a lot. minihotto
-
I met a problem. I have a server and a client. Client connect to server. It works and client can send message to server. But how can I send message from server to client? I try to let server connect to client, but it says it already connected. How could I let server send message to client,too? Can somebody give me an example? Thanks a lot. minihotto
Server can not connect to client. It can - of course send data as a reply but can not initialize connection. You have to open another port (socket) to listen. It is mean your application must have both parts - server and client. (client has to also listen - to be possible to connected it by "server")
viliam
-
I met a problem. I have a server and a client. Client connect to server. It works and client can send message to server. But how can I send message from server to client? I try to let server connect to client, but it says it already connected. How could I let server send message to client,too? Can somebody give me an example? Thanks a lot. minihotto
-
http://www.codeproject.com/internet/[^]
led mike
-
Yes it is a web page listing articles that contain sample/example Socket code. Please "READ" the web page.
led mike
-
Server can not connect to client. It can - of course send data as a reply but can not initialize connection. You have to open another port (socket) to listen. It is mean your application must have both parts - server and client. (client has to also listen - to be possible to connected it by "server")
viliam
-
I met a problem. I have a server and a client. Client connect to server. It works and client can send message to server. But how can I send message from server to client? I try to let server connect to client, but it says it already connected. How could I let server send message to client,too? Can somebody give me an example? Thanks a lot. minihotto
Is your server/client system using SOCK_DGRAM or SOCK_STREAM. if you are using SOCK_STREAM then once the connection is accepted using the accept function there should be a socket variable that the client is connected to. SOCKET server; //assume already in listen state SOCKET client = accept(server, ...); use the client variable to send messages back to the client machine like the following: send(client, ...);
Chipper Martin