bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getPeer(tpport_t *port) and SocketPort for bound UDPSockets broken?


From: Federico Montesino Pouzols
Subject: Re: getPeer(tpport_t *port) and SocketPort for bound UDPSockets broken?
Date: Sat, 27 Dec 2003 22:38:05 +0100
User-agent: Mutt/1.5.4i

        Hi, do you see that broken behaviour with UDPSocket before
receiving any packet on the socket? UDPSocket::getPeer uses the
'recvfrom' system call to retrieve the actual current peer the socket
is receiving from. If no packet has been received so far or is not
available, recvfrom will return 0. For an UDP socket, the peer is not
so clearly defined as for a TCP socket. I guess it would be helpful to
point this out in the SocketPort docs.

On Sat, Dec 27, 2003 at 05:57:55AM +0100, Wolfgang wrote:
> Hello,
> 
> when using getPeer(tpport_t *port) in a derived class from SocketPort using a 
> CTOR for a bound UDPSocket, getPeer always returns 0.0.0.0:0 (Adress and port 
> eq 0).
> However when using an explicit UDPSocket, UDPSocket::getPeer works.
> 
> Doing the same with SocketPort and a bound TCPSocket is not a problem.
> 
> It seems that this is because UDPSocket overloads getPeer from Socket, which 
> is not the case for TCPSocket. So SocketPort will not call UDPSocket::getPeer 
> but Socket::getPeer (which works for TCPSocket's).
> 
> Best regards
> 
> Wolfgang
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]