Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PIPXSocket::ReadFrom ( void *  buf,
PINDEX  len,
Address addr,
WORD &  port 
) [virtual, inherited]

Read a datagram from a remote computer.

Returns:
TRUE if all the bytes were sucessfully written.
Parameters:
buf  Data to be written as URGENT TCP data.
len  Number of bytes pointed to by buf#.
addr  Address from which the datagram was received.
port  Port from which the datagram was received.

Definition at line 1251 of file winsock.cxx.

References PChannel::lastReadCount, and PSocket::Net2Host().

{
  lastReadCount = 0;

  sockaddr_ipx sip;
  int addrLen = sizeof(sip);
  if (os_recvfrom(buf, len, 0, (struct sockaddr *)&sip, &addrLen)) {
    AssignAddress(addr, sip);
    port = Net2Host(sip.sa_socket);
  }

  return lastReadCount > 0;
}


Generated by  Doxygen 1.6.0   Back to index