Read read up to bufferLen bytes data from this socket. The given buffer is where the data will be placed
Definition at line 340 of file PracticalSocket.cpp. References Socket::sockDesc. 00341 { 00342 sockaddr_in clntAddr; 00343 socklen_t addrLen = sizeof(clntAddr); 00344 int rtn; 00345 if ((rtn = recvfrom(sockDesc, (raw_type *) buffer, bufferLen, 0, 00346 (sockaddr *) &clntAddr, (socklen_t *) &addrLen)) < 0) { 00347 throw SocketException("Receive failed (recvfrom())", true); 00348 } 00349 sourceAddress = inet_ntoa(clntAddr.sin_addr); 00350 sourcePort = ntohs(clntAddr.sin_port); 00351 00352 return rtn; 00353 }
|