Click to See Complete Forum and Search --> : sockets question


neo_the_1
November 11th, 2004, 12:00 PM
hello,

using a udp socket, is it ok and legal to do some thing like this :

pSocket->SendTo( "http://www.mydomain.com" ), and to receive the
message on a server ?

thanks

chi_luci
November 11th, 2004, 12:30 PM
no, I guess it's not.. u must supply a SOCKADDR structure as described in MSDN..

//MSDN
Call this member function to send data to a specific destination.

int SendTo(
const void* lpBuf,
int nBufLen,
UINT nHostPort,
LPCTSTR lpszHostAddress = NULL,
int nFlags = 0
);
int SendTo(
const void* lpBuf,
int nBufLen,
const SOCKADDR* lpSockAddr,
int nSockAddrLen,
int nFlags = 0
);

Andreas Masur
November 11th, 2004, 04:33 PM
[ Moved thread ]