Discussion:
[omniORB] question about blocking socket mode in omniORB-4.1.1
Nikola Radovanovic
2009-03-03 19:07:56 UTC
Permalink
Hi,
we have a question regarding blocking/non-blocking socket mode in
omniORB-4.1.1:
in method giopActiveConnection* tcpAddress::Connect(unsigned long
deadline_secs, unsigned long deadline_nanosecs, CORBA::ULong
strand_flags) const (in tcpAddress.cc:299);
after connection is successfully established, connected socket is set to
blocking mode by following piece of code:

if (SocketSetblocking(sock) == RC_INVALID_SOCKET) {
CLOSESOCKET(sock);
return 0;
}

Why is this done when select() is used in
int tcpConnection::Recv(void* buf, size_t sz, unsigned long
deadline_secs, unsigned long deadline_nanosecs) - in
tcpConnection.cc:283
int tcpConnection::Send(void* buf, size_t sz, unsigned long
deadline_secs, unsigned long deadline_nanosecs) - in
tcpConnection.cc:351



thanks for the replies
Telvent DMS
Duncan Grisby
2009-03-13 19:00:38 UTC
Permalink
Post by Nikola Radovanovic
in method giopActiveConnection* tcpAddress::Connect(unsigned long
deadline_secs, unsigned long deadline_nanosecs, CORBA::ULong
strand_flags) const (in tcpAddress.cc:299);
after connection is successfully established, connected socket is set
if (SocketSetblocking(sock) == RC_INVALID_SOCKET) {
CLOSESOCKET(sock);
return 0;
}
Why is this done when select() is used in
int tcpConnection::Recv(void* buf, size_t sz, unsigned long
deadline_secs, unsigned long deadline_nanosecs) - in
tcpConnection.cc:283
int tcpConnection::Send(void* buf, size_t sz, unsigned long
deadline_secs, unsigned long deadline_nanosecs) - in
tcpConnection.cc:351
It's done because select() / poll() are not always used in Send() and
Recv(). If there is no call timeout specified, the underlying send() /
recv() calls are allowed to block.

Is it causing you a problem?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...