bug-commoncpp
[Top][All Lists]
Advanced

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

datagram sockets bound at creation cannot send data


From: Claude Brisson
Subject: datagram sockets bound at creation cannot send data
Date: Thu, 09 Dec 2004 01:02:33 +0100

Hi

I found a strange behaviour of the UDPSocket class.

When an UDPSocket is created using the constructor :
UDPSocket::UDPSocket(InetHostAddress("127.0.0.1"),0)
then its send method fails with EINVAL (Invalid argument).

If I create an unbound UDPSocket using the default constructor, the send
method works.

I've attached a sample program that reproduces the problem.

Everything occurs as if the former constructor allowed only receiving
sockets. I know that it is not always advised to send and receive data
using the same datagram socket (collisions, etc...), but
bidirectionality should remain possible... moreover, an UDPSocket that
is created unbound can receive data after a first send.

Thanks for your response,

Claude

Attachment: testsocket.cpp
Description: Text Data


reply via email to

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