LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-05-2004, 01:29 AM   #1
BBQ_Matt
LQ Newbie
 
Registered: Sep 2003
Location: Sydney, Australia
Distribution: ubuntu, suse, redhat
Posts: 18

Rep: Reputation: 0
Traps with Perl and fifo's


Hi there,

I've written a small perl script that connects to a TCP/IP socket, read's in thunks of data and write's it to a fifo output. This script is invoked around 120 times, so I have 120 perl scripts read from 120 TCP/IP sockets (they are all different) and all pushing there data into a fifo.

I've controlled the access to the fifo by locking it before writing to it like this for 1 line:

Code:
	flock($Index, LOCK_EX);
	syswrite  $Index, $Line;
	flock($Index, LOCK_UN);
and like this if I have a multi-line thunks of data.

Code:
	flock($Index, LOCK_EX);
	syswrite $Index, join "", @Array;
                flock($Index, LOCK_UN);
At the other end of the fifo, I have a process that is reading and passing the fifo through a TCP/IP socket to whomever connects to a certain port.

So, basically I have a serious of perl scripts that is combining 120 TCP/IP feeds down to one feed.

Here is my problem,

There seems to be a corruption of data occur and perl (with -w) doesn't seem to be picking it up. As far as the scripts are concerned everything is working fine. However, I am getting missing thunks of data especially during peak loads. I know this, because I have a system connected at the other end which complains about the data it's recieveing.

My questions are:
- Are there any traps in trying to pipe all this data (and it can be alot) into 1 fifo?
- Should I consider using something other than a fifo and what would that be?
- Is there an opensource eqivalent to my data combiner out there?
- Are there any other traps that could be causing the loss of data without reporting memory, cpu or data error's?

I need serious help here.

Thanks for reading.
 
  


Reply



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
snmp traps to syslog jackpal Linux - Networking 2 08-30-2005 03:43 AM
The Traps Of Linux & Open Source Software john20004 General 48 07-17-2004 04:00 PM
How do i increase the size of the linux fifo's currently set to 4K in 2.6 kernel ? ayb Programming 2 06-25-2004 07:55 AM
The Traps Of Linux...&open Source Software john20004 Linux - General 1 04-22-2004 03:16 PM
The Traps Of Linux...&open Source Software john20004 LQ Suggestions & Feedback 1 04-22-2004 02:46 PM

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

All times are GMT -5. The time now is 11:34 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
Open Source Consulting | Domain Registration