I am trying to send message to the other machine on a lan. but it fails to deliver that, i am using the code that exist on the vbworld site.
Printable View
I am trying to send message to the other machine on a lan. but it fails to deliver that, i am using the code that exist on the vbworld site.
If you followed the example, the problem is most likely due to the socket being closed before the SendData finished its task.
If you want to close the connection after the data has been sent, put the Winsock1.Close in a Winsock1_SendComplete routine. If not, either close the socket in the Form_Unload or add a Close menu option or command button.
IMHO, the example on this site gives the basics but fails to take a lot of preventive measures. These shortcomings have generated a lot of posts such as yours.