Sponsored Content
Special Forums IP Networking Problems and doubts with sockets and timeouts Post 302966204 by Kovalevski on Tuesday 9th of February 2016 11:45:41 AM
Old 02-09-2016
Hi gull04 and thank you for you answer

*When you say you are having a "timeout" I'm going with the listener has timed out, in which case the messages are gone - nothing was listening for them.
--->Ok, yes I thought the same but maybe , just maybe the message is stucked in some
"magical" Smilie buffer and the message arrive after

*Once the listener has timed out, it won't matter how many messages that are sent -
nothing is listening for them.
---> Ok I did not explain that , but the recv is in a while loop , when a timeout happen the
connection is closed and the server wait for a new connection. After that, the server is
again hear for new messages

*Why the time out occurs before the message arrives could be down to a number of reasons, but most likely traffic on the network OR LOAD ON THE SYSTEM.
--->I started to suspect about that. I was debug this in two computers and when the timeout happened the server computer was doing some hard disk things (I heard the disk)
. About the network traffic that is a question How I can to know if the traffic on the
network is elevated or not?

* The time out seems to be very short at a second, can you post some more detail about what you are trying to do?
---> I just want to know as quickly as possible when the server or the connection dropped. I thought in use TCP_KEEP_ALIVE In this link (https://www.digi.com/wiki/developer/..._and_Keepalive) explains how activate TCP_KEEP_ALIVE but also in that link explain this

Code:
"Do NOT try to use TCP Keepalive to detect TCP socket failure more quickly than a few
minutes. People who try to set it for 5 seconds (or for milliseconds) invariably cause 
serious compatibility issues with other products - and invariably fail to be satisfied. If you 
truly require detecting a TCP socket failure in 1 second or less, which implies your TCP 
peers normally send data many times per second, then use non-blocking sockets with the
 "socket.timeout" exception to detect when no data had been received in your required 
time-frame. And if you accept that a TCP peer quiet for 1 second is bad, then close the 
socket manually and attempt recovery directly. Do not use TCP Keepalive for such short-
period detection. "

Thanks!
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

UNIX Network timeouts

Hi, can anyone point me in the right direction regarding a UNIX setting that determines when a network connection will timeout? I am getting network timeouts and I would like to know if there is a setting in UNIX 11i OS that I can modify to increase the time limit. Thank you (4 Replies)
Discussion started by: Allano
4 Replies

2. UNIX for Dummies Questions & Answers

Device Timeouts on Unix Server

Hi I am brand new to the forum I have very limited understanding of unix, but am very computer literate. At work we have a unix server which has been the bane of our lives. We have stopped being able to access the network drives and the screen has lots of device timeouts. I have learned how to do... (1 Reply)
Discussion started by: scovell01
1 Replies

3. UNIX for Advanced & Expert Users

Facing file processing timeouts

Hi In our ETL application we have used simple scripts to move & split the files. We are randomly facing timeouts on these jobs. It indicates we are running out of resources. How should I confirm the resources are inadequate? I know we have commands like vmstat & iostat which displays... (3 Replies)
Discussion started by: videsh77
3 Replies

4. UNIX for Dummies Questions & Answers

Unix doubts

Hello All, I am very new to UNIX. Please help me to find answers of below questions. 1.A script is saved with name ls. When we execute the script what it will execute? a) Will execute ls command b) Will execute the script c) Will execute script or command depends on the path ... (2 Replies)
Discussion started by: aswathy
2 Replies

5. Shell Programming and Scripting

doubts in crontab

Hi All, I am tring to set a shedule for cron to execute my script in every 15 min, n want a mail alert on my mail id if cron fails to get data as input for my script, how can i set that? Thanks in advance Subin (1 Reply)
Discussion started by: subin_bala
1 Replies

6. UNIX for Dummies Questions & Answers

Doubts on FIFO

Hi , I m beginner for Unix and i want to use FIFO in my 2 Scripts . I want 1 script to read data from FIFO and other will write into FIFO. Despite reading so many articles/posts i am still unable sunchronize my scripts. My doubts are 1> Do We require both scripts as daemons to use... (0 Replies)
Discussion started by: Akshay
0 Replies

7. UNIX for Dummies Questions & Answers

Unix doubts

Hi All, 1. how and who calls .profile when you login 2. what is PPID and what means by PPID = 0 Thanks in Advance (2 Replies)
Discussion started by: ravi.sadani19
2 Replies

8. Programming

Machine dependent problems when using Sockets.

I am trying to write code for a client-server scenario using AF_INET sockets.. As is usually the case, everything works fine and dandy on my machine, but gives me the following error at runtime: send: Socket operation on non-socket The error is thrown by the server when trying to send the... (5 Replies)
Discussion started by: ab_tall
5 Replies

9. Shell Programming and Scripting

Timeouts in expect script

Hi all. I have an expect script which for walks across servers, checks freespace and provides sorted list of biggest files #!/usr/bin/expect -- set timeout 600 stty -echo log_user 0 spawn -noecho sudo -u introot /home/introot/bin/twssh expect root send_user "Entering \r" send "uname\r"... (15 Replies)
Discussion started by: urello
15 Replies
socket.h(3)						     Library Functions Manual						       socket.h(3)

NAME
socket.h - Network addresses and sockets related classes. SYNOPSIS
#include <cc++/address.h> Classes class ost::Socket The Socket is used as the base for all Internet protocol services under Common C++. class ost::DCCPSocket DCCP sockets are used for stream based connected sessions between two sockets. class ost::UDPSocket UDP sockets implement the TCP SOCK_DGRAM UDP protocol. class ost::UDPBroadcast Representing a UDP socket used for subnet broadcasts, this class provides an alternate binding and setPeer() capability for UDP sockets. class ost::UDPTransmit Representing half of a two-way UDP connection, the UDP transmitter can broadcast data to another selected peer host or to an entire subnet. class ost::UDPReceive Representing half of a two-way UDP connection, the UDP receiver can receive data from another peer host or subnet. class ost::UDPDuplex UDP duplex connections impliment a bi-directional point-to-point UDP session between two peer hosts. class ost::TCPSocket TCP sockets are used for stream based connected sessions between two sockets. class ost::TCPV6Socket TCPV6 sockets are used for stream based connected sessions between two ipv6 sockets. class ost::TCPStream TCP streams are used to represent TCP client connections to a server by TCP protocol servers for accepting client connections. class ost::TCPSession The TCP session is used to primarily to represent a client connection that can be managed on a separate thread. class ost::SimpleTCPStream Simple TCP Stream, to be used with Common C++ Library. Namespaces namespace ost Macros #define INVALID_SOCKET -1 #define _IOLEN64 #define _IORET64 #define MSG_DONTWAIT 0 #define MSG_NOSIGNAL 0 #define SOCK_DCCP 6 #define IPPROTO_DCCP 33 #define SOL_DCCP 269 #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 #define DCCP_SOCKOPT_CCID 13 #define DCCP_SOCKOPT_TX_CCID 14 #define DCCP_SOCKOPT_RX_CCID 15 Typedefs typedef int SOCKET Variables class __EXPORT ost::SimpleTCPStream Detailed Description Network addresses and sockets related classes. Macro Definition Documentation #define _IOLEN64 Referenced by ost::SocketPort::peek(), ost::UDPSocket::peek(), ost::TCPStream::peek(), ost::SocketPort::receive(), ost::UDPReceive::receive(), ost::SocketPort::send(), ost::UDPTransmit::send(), and ost::UDPTransmit::transmit(). #define _IORET64 #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 #define DCCP_SOCKOPT_CCID 13 #define DCCP_SOCKOPT_RX_CCID 15 #define DCCP_SOCKOPT_TX_CCID 14 #define INVALID_SOCKET -1 #define IPPROTO_DCCP 33 #define MSG_DONTWAIT 0 Referenced by ost::UDPTransmit::transmit(). #define MSG_NOSIGNAL 0 Referenced by ost::UDPTransmit::send(), and ost::UDPTransmit::transmit(). #define SOCK_DCCP 6 #define SOL_DCCP 269 Typedef Documentation typedef int SOCKET Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 socket.h(3)
All times are GMT -4. The time now is 03:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy