Sponsored Content
Special Forums IP Networking Problems and doubts with sockets and timeouts Post 302966202 by gull04 on Tuesday 9th of February 2016 10:57:31 AM
Old 02-09-2016
Hi Kovalevski,

Just going to take a couple of guesses here with your questions;

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.

Once the listener has timed out, it won't matter how many messages that are sent - nothing is listening for them.

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.

The time out seems to be very short at a second, can you post some more detail about what you are trying to do?

Regards

Gull04
 

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
MIMEDEFANG-NOTIFY(7)					 Miscellaneous Information Manual				      MIMEDEFANG-NOTIFY(7)

NAME
mimedefang-notify - Conventions used by mimedefang-multiplexor(8) to notify an external program of state changes. DESCRIPTION
If you supply the -O option to mimedefang-multiplexor, then it allows external programs to connect to a socket and be notified of certain state changes in the multiplexor. The external programs can react in whatever way they choose to these state changes. The external pro- gram that listens for state changes is referred to as a listener. NOTIFICATION OVERVIEW
From the point of view of a listener, notification works like this: 1) The listener connects to a TCP or UNIX-domain socket. 2) The listener informs mimedefang-multiplexor of the message types it is interested in. 3) The listener loops, reading messages from the socket and reacting to them. MESSAGES
Each message from the multiplexor normally consists of a single upper-case letter, possibly followed by a space and some arguments, and then followed by a newline. Two special messages are "*OK" followed by a newline, which is issued when a listener first connects, and "*ERR" followed by some text and a newline, which is issued when an error occurs. The normal messages are: B This message is issued whenever a slave is killed because of a busy timeout. F n This message is issued whenever the number of free slaves changes. The parameter n is the number of free slaves. R This message is issued whenever someone has forced a filter reread. S n nmsg This message is issued whenever slave n's status tag changes. The status tag is a string indicating what the slave is currently doing; the -Z option to the multiplexor allows the Perl code to update the status tag so you have a good idea what each slave is doing. U This message is issued whenever a slave has died unexpectedly. Y This message is issued whenever the number of free slaves changes from zero to non-zero. Z This message is issued whenever the number of free slaves falls to zero. EXPRESSING INTEREST
A listener does not receive any messages until it has expressed interest in various message types. To express interest, the listener should send a question mark ("?") followed by the types of messages it is interested in, followed by a newline over the socket. For exam- ple, a listener interested in the R and F messages would send this line: ?RF A listener interested in every possible message type should send: ?* Once a listener has expressed interest, it may receive messages at any time, and should monitor the socket for messages. Note that a listener always receives the special messages "*OK" and "*ERR", even if it has not expressed interest in them. EXAMPLE
The following Perl script implements a listener that, on Linux, rejects new SMTP connections if all slaves are busy, and accepts them again once a slave is free. Existing SMTP connections are not shut down; the system merely refuses new connections if all the slaves are busy. This script assumes that you have used the -O inet:4567 option to mimedefang-multiplexor. #!/usr/bin/perl -w # # On Linux, prepare to use this script like this: # /sbin/iptables -N smtp_connect # /sbin/iptables -A INPUT --proto tcp --dport 25 --syn -j smtp_connect # Then run the script as root. use IO::Socket::INET; sub no_free_slaves { print STDERR "No free slaves! "; system("/sbin/iptables -A smtp_connect -j REJECT"); } sub some_free_slaves { print STDERR "Some free slaves. "; system("/sbin/iptables -F smtp_connect"); } sub main { my $sock; $sock = IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => '4567', Proto => 'tcp'); # We are only interested in Y and Z messages print $sock "?YZ "; $sock->flush(); while(<$sock>) { if (/^Z/) { no_free_slaves(); } if (/^Y/) { some_free_slaves(); } } # EOF from multiplexor?? Better undo firewalling system("/sbin/iptables -F smtp_connect"); } main(); SEE ALSO
mimedefang.pl(8), mimedefang(8), mimedefang-multiplexor(8), mimedefang-filter(5) 4th Berkeley Distribution 8 February 2005 MIMEDEFANG-NOTIFY(7)
All times are GMT -4. The time now is 08:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy