I want to send a message and receive a message using winsock to and from another computer in other city.I want to use VBA, and I have compiled a bas module which appear to be ok. The idea here is to try and translate the C++ code as below:
VBA for sending:
Questions?
Sending
On the socketID do I need to hard code the destination IP address and port number of the other computer in a different city? Any example
Receiving
On the socketID do I need to hard code my destination IP address and port number of my computer? How do I get to know my port number?
I have no issue how to get my IP address by using IPconfig
Code:
socketID = socket(AF_INET, SOCK_STREAM, 0)
VBA for sending:
Code:
count = send(socketID, ByVal strSend, Len(strSend), 0)
Questions?
Sending
On the socketID do I need to hard code the destination IP address and port number of the other computer in a different city? Any example
Receiving
On the socketID do I need to hard code my destination IP address and port number of my computer? How do I get to know my port number?
Code:
count = recv(socketID, buf(1), maxLength, iFlags)
I have no issue how to get my IP address by using IPconfig