Try this???

This function is used to send data to a specific destination.

The following User Defined Type (UDT) is required:

Type sockaddr

sa_family As Integer
sa_data(14) As Byte

End Type

Where:


sa_family = For TCP/IP this should be the value of AF_INET (AF_INET = 2).
sa_data(14) = Interpretation of this data is based on sa_family. An internet address could be stored in the first 6 bytes of sa_data and the other 8 bytes could be zeroed.

The following function declaration is required:


Declare Function sendto Lib "wsock32.dll" (ByVal s As Long, ByRef buf As Any, ByVal buflen As Integer, ByVal flags As Integer, ByRef toaddr As sockaddr, ByRef tolen As Integer) As Integer


Where:


s = A descriptor identifying a connected socket
buf = A buffer for the incoming data
buflen = The length of buf
Flags = Specifies the way in which the call is made
toaddr = An optional pointer to the address of the target socket
tolen = The size of the address in toaddr

If no error occurs, sendto() returns the to number of bytes sent. This may be less than the number indicated by buflen. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code may be retrieved by calling WSAGetLastError().