Solved

port reader (socket) script

Posted on 2007-03-28
6
278 Views
Last Modified: 2010-04-20
We require a  port reader services program running  a port assignment in the 9000-11000 range for on your Linux box. Can we get a perl script for this service?
0
Comment
Question by:judejames
  • 4
  • 2
6 Comments
 
LVL 25

Expert Comment

by:Cyclops3590
ID: 18808973
Not entirely sure I understand what you want.  You want a server daemon that will listen on a port between 9000-11000?  Why not just one port?  Also, does this have to be running at all times like a daemon or can it be ran when a connection is made?  If a daemon, I am not sure as I haven't done that before.  I don't see why it isn't, just don't know how.  As for the second, the easiest is to create a new entry for the Xinetd service and have that use a port assignment.

however could use more clarification on what your trying to do.
0
 

Author Comment

by:judejames
ID: 18809474
i mean any port between 9000-11000, yes, has to run all the time. daemon...we want a tcp socket (i think for print jobs)  to be open on our server which will take a stream of data and save it as a file on our server (also called a virtual printer..)
0
 
LVL 25

Expert Comment

by:Cyclops3590
ID: 18809526
what type of file format is it suppose to be saved in?  Just curious, because if you use samba, it can share a virtual printer from there that will convert documents to a pdf.

just trying to think of other options so you don't have to re-invent the wheel if at all possible (besides I don't know how to program a always running daemon in perl so am trying to think of other ways I do know how to do)
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:judejames
ID: 18809550
well buddy i think we will  have to reinvent 'cause we are receiving it from a VPS/DRS printing system... we will get a text format data. and we just have to save it in a file...we will have to create a tcp socket.
0
 
LVL 25

Accepted Solution

by:
Cyclops3590 earned 500 total points
ID: 18809625
gotcha,
found this page when googling and it looks fairly good (to me anyway)
http://www.devshed.com/c/a/Perl/Socket-Programming-in-PERL/2/

does this put you in the right direction?
0
 
LVL 25

Expert Comment

by:Cyclops3590
ID: 18809645
then probably make the port a command line argument when starting it, then create another script that starts all the daemon's and loops thru all the ports you need to open.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question