oh, and you are on the right track =)
Just tell me, please
I think what I need to do is #include
then insert the code something like
connect( *host )
sendto( *host )
then put here whatever I want to send, am I even on the right track?
and if this is right, how do i get the other side to receive it, and how exactly should I send the info that I want to send?
Thanks in advance
You are on the right track, but before you go too much further you might want to sort out in your mind what you intend to do.
Winsock allows socket communication in two basic modes.
Datagram sockets
Stream sockets
Both of these types have benefits and disadvantages.
Stream sockets are point-to-point. One end of the connection is the client, who uses connect() to connect to the server. The server uses listen() to listen for connections, and accept() to accept the connection from the client. From there, they both use send() and recv() to send and recieve data in a stream. By stream, I mean one character after another. All data is guaranteed to get from client to server and vice versa in the order it went out. This is an important distinction since..
Datagram sockets are different. Datagram sockets do not require the connect, listen() and accept() scheme, and can really just be used with sendto() and recvfrom(). In truth, though, you still need to use bind() to get the server to bind to a port. This is used to stablize the network transactions. The other differences of datagram sockets are that they don't send in streams. They send one packet of a user definable size each time, and are not guaranteed to ever reach the destination, nor to reach the destination in any order. That is to say, if you sendto("packet a"), then sendto("packet b"), you might get packet B before packet A, or packet B may never arrive. In actuallity, not that many packets do go missing, I find, but I might be lucky.
Some additional information from a good book can be found online at:
http://www.sockets.com/
I hope that helps.