LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2006, 04:10 PM   #1
kwopublic
LQ Newbie
 
Registered: Jan 2006
Posts: 1

Rep: Reputation: 0
How do I set a socket's receive buffer size from Perl?


Hello all,
Any help on this question would be appreciated. I am a newbie to this site, so I have not figured my way around yet. Forgive me if this question is answered somewhere else.


My application runs on RH Linux. I have set of perl processes that are communicating through a UNIX socket.

my $s = IO::Socket::UNIX->new(
Type => SOCK_STREAM,
Local => $sockname,
Listen => 10,
ReuseAddr => 1,
);

One of these processes goes away for an extended period of time and comes back eventually. During this time it is not able to read from it's pipe. This is causing the other process that is writing to the pipe to wait for an extended period of time. When this happens, bad things occur in my application.

One idea I would like to try is to set the socket's underlying recieve buffer to as large as possible.

Questions:
Can anyone tell me how to set the socket's underlying receive buffer size?

What is the maximum size that the buffer can be?

It seems that the writing process gets stuck trying to write to this processes socket. How do I make the writer return immediately even if it cannot write all of the data?


Thanks in advance,
ko
 
Old 01-23-2006, 06:38 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
You could try wrapping a SIGALRM (ie sig alarm) around it so it times out...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating buffer size cynthia_thomas Programming 1 01-19-2006 10:49 PM
how to increase serial receive email buffer size? HZC Programming 0 02-14-2005 10:32 PM
Perl and its buffer (though) enemorales Programming 2 02-09-2005 03:17 AM
CD write buffer size rch Linux - General 1 09-26-2003 05:50 PM
Send Receive Buffer in Linux? defa0009 Linux - General 6 06-21-2003 04:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration