Sending messages with Server/Client
-
Hi All, I'm new to programming, so i have been trying to read and go to a few classes. I have been reading the tutorials on Server/Clients and am still a little confused. Right now i have a dialog that has a couple of check boxes on it, and I want to send the information of whether the boxes are checked or not to the server side . The message is just a string that looks like this : 2000 or 2001 I know that the two connect, but I can not get the message to be sent to the server. I am using the command:
send (socket, buf,strlen(buf),0)
where socket is instantiated in another dialog class that i use to connect to the server. How do I use the same socket that is already connected to the server to send this message. It won't compile unless i instantiate another socket in the dialog class with the check boxes. Many thanks in advance. -
Hi All, I'm new to programming, so i have been trying to read and go to a few classes. I have been reading the tutorials on Server/Clients and am still a little confused. Right now i have a dialog that has a couple of check boxes on it, and I want to send the information of whether the boxes are checked or not to the server side . The message is just a string that looks like this : 2000 or 2001 I know that the two connect, but I can not get the message to be sent to the server. I am using the command:
send (socket, buf,strlen(buf),0)
where socket is instantiated in another dialog class that i use to connect to the server. How do I use the same socket that is already connected to the server to send this message. It won't compile unless i instantiate another socket in the dialog class with the check boxes. Many thanks in advance. -
Under winsock, the program calls Win32 API to access the socket. If you wanted to send data on one object and receive data in another object, then one solution is to pass the socket. Kuphryn
I'm sorry but i do not understand what to do. Once I have the client and the server connected, how do i send the message to the server? It doesn't seem to send the data to the server. Is there something I have to pass between the two cpp files, or can i just connect and then instantiate a SOCKET object and send it to that? Can someone possible give me some sample code...i looked at the tutorials on this site but i still can't get it to work. Thanks in advance.