Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

unsigned short Socket::getLocalPort (  )  throw (SocketException)

Get the local port.

Returns:
local port of socket
Exceptions:
SocketException thrown if fetch fails

Definition at line 123 of file PracticalSocket.cpp.

References sockDesc.

00123                                                            {
00124   sockaddr_in addr;
00125   unsigned int addr_len = sizeof(addr);
00126 
00127   if (getsockname(sockDesc, (sockaddr *) &addr, (socklen_t *) &addr_len) < 0) {
00128     throw SocketException("Fetch of local port failed (getsockname())", true);
00129   }
00130   return ntohs(addr.sin_port);
00131 }


Generated on Thu Jan 13 09:13:08 2011 for ImpalaSrc by  doxygen 1.5.1