View Single Post
Old 18-12-2009, 23:57   #6
marco.r
Senior Member
 
Iscritto dal: Dec 2005
Città: Istanbul
Messaggi: 1817
[quote]
Codice:
err = WSARecv(sock, &DataBuf, 1, &lpNumberOfBytesRecvd, &lpFlags, &RecvOverLapped, 0);
if(err == -1) { mngmt_sock_error(); break; }
Occhio che l'autore del thread chiedeva come fare sotto linux.
Quindi andrebbe fatto qualcosa tipo
Codice:
void set_timeout(int sock)
{
  struct timeval tv;
  tv.set = 20;
  tv.usec = 0;
  setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, tv, sizeof(tv) );
}
__________________
One of the conclusions that we reached was that the "object" need not be a primitive notion in a programming language; one can build objects and their behaviour from little more than assignable value cells and good old lambda expressions. —Guy Steele
marco.r è offline   Rispondi citando il messaggio o parte di esso