Re: avoid errors when printing to socket

2021-10-02 Thread hw
int stmt returning undef will tell you the same thing. I tried that, and print didn't return undef. Let's see, we need a better example here ... #!/usr/bin/perl use strict; use warnings; use utf8; use IO::Socket::INET; my $addr = '192.168.33.33'; # use an address not in

Re: avoid errors when printing to socket

2021-10-01 Thread Andy Bach
, September 30, 2021 9:30:01 PM CEST Andy Bach wrote: > > > https://perldoc.perl.org/functions/print says that 'print' would > return > > > > true > > > > > if successful and doesn't say what it returns otherwise. It also says > > > >

Re: avoid errors when printing to socket

2021-09-30 Thread hw
On Thursday, September 30, 2021 9:30:01 PM CEST Andy Bach wrote: > > https://perldoc.perl.org/functions/print says that 'print' would return > > true > > > if successful and doesn't say what it returns otherwise. It also says > > that > > > &

Re: avoid errors when printing to socket

2021-09-30 Thread Andy Bach
> https://perldoc.perl.org/functions/print says that 'print' would return true > if successful and doesn't say what it returns otherwise. It also says that > "Printing to a closed pipe or socket will generate a SIGPIPE signal." Looks like print returns 1 if it

avoid errors when printing to socket

2021-09-30 Thread hw
Hi, I have a program in which I'm creating an UDP socket with IO::Socket::INET to a device on my LAN. Opening the socket yields no error. Writing to the socket with 'print' works fine. The device sends data back, and receiving the data works fine. But it doesn't wor

Re: socket recive problem

2021-04-04 Thread Raunak Kathuria
You can use https://gist.github.com/raunakkathuria/633f46222f7d3a40c2ecd0234e1cb3e0 as a reference example of socket connection using IO::Async::* Hope that's useful. On Mon, Apr 5, 2021 at 12:00 AM Shlomi Fish wrote: > On Fri, 2 Apr 2021 13:46:35 -0400 > Uri Guttman wrote: > &

Re: socket recive problem

2021-04-04 Thread Shlomi Fish
ection recieved from $name\n";,  but  $name > > is  blank , why ?? thanks > > this is a script > > > > don't use low level socket stuff as it is tricky to get correct. use the > IO::Socket module as it is correct and very easy to use. > I agree. S

Re: socket recive problem

2021-04-02 Thread Uri Guttman
s a script don't use low level socket stuff as it is tricky to get correct. use the IO::Socket module as it is correct and very easy to use. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: socket recive problem

2021-04-02 Thread thelip sia
a client (write in C++) , if i > use netcat , work ok but when i use a script in perl work partially , > recive "Connection recieved from $name\n";, but $name is blank , why ?? > thanks > this is a script > use strict; > use Socket; > > # use port 7890 a

socket recive problem

2021-04-02 Thread stefano cerbioni
hi i try to recive a stream string by a client (write in C++) , if i use netcat , work ok but when i use a script in perl work partially , recive "Connection recieved from $name\n";, but $name is blank , why ?? thanks this is a script use strict; use Socket; # use port 7890 as

Re: IO::Socket::Multicast::mcast_send

2020-04-05 Thread James Kerwin
A I managed to find the problem thanks to somebody else finding it late last year. With the particular verison of Perl on the Pi (I think I said 5.28) there is a bug for the IO::Socket::Multicast module: https://rt.cpan.org/Public/Bug/Display.html?id=130581 To fix it I went in to where the

Re: IO::Socket::Multicast::mcast_send

2020-04-05 Thread James Kerwin
I activate it the script does not work, but it doesn't give an error pointing at the line where $socket->mcast_send is called, as it does on the pi. iptables gives a massive output. 2) I have not tried it with the latest stable version of Perl, partly because I have several different ver

Re: IO::Socket::Multicast::mcast_send

2020-04-05 Thread Shlomi Fish
Hi James, On Sun, 5 Apr 2020 14:58:26 +0100 James Kerwin wrote: > Hi All, > > I'm trying to connect to a smart bulb on my home WIFI using mcast_send > in IO::Socket::Multicast. > > It works on my main Linux Mint laptop. The same script does not work on my > Rasp

IO::Socket::Multicast::mcast_send

2020-04-05 Thread James Kerwin
Hi All, I'm trying to connect to a smart bulb on my home WIFI using mcast_send in IO::Socket::Multicast. It works on my main Linux Mint laptop. The same script does not work on my Raspberry PI. Despite the script running as expected on one laptop I've checked that this is all set up

Re: reading from socket

2015-09-18 Thread Brandon McCaig
On Thu, Sep 17, 2015 at 10:55:58PM +0200, Chris Knipe wrote: > Hi All, Hello, > Running under Net::Server, I have: Unfortunately, you seem to be neglecting to give us full programs to test with which requires us to do guess work. The best way to get help is to do your best to reproduce the probl

Re: reading from socket

2015-09-17 Thread Chris Knipe
> > > Hello Chris. > > Can you provide the yenc files? > Both the good one and the bad one? > http://expirebox.com/download/f7ebd6e37cf576e29df89bb6ae78ded4.html - Includes the two original files (text document, and binary image) - Includes the yEnc version of both files, as received by Perl (po

Re: reading from socket

2015-09-17 Thread David Emanuel da Costa Santiago
at the failed file has 3 extra bytes... It should end at > 77859, but instead, it ends at 77862. So where does those extra > three bytes come from? > > *completely, lost* > > > > > > -Original Message- > From: Chris Knipe [mailto:sav...@savage.za.org] > Sent: Thur

RE: reading from socket

2015-09-17 Thread Chris Knipe
m? *completely, lost* -Original Message- From: Chris Knipe [mailto:sav...@savage.za.org] Sent: Thursday, September 17, 2015 10:56 PM To: 'beginners@perl.org' Subject: RE: reading from socket Hi All, I'm SERIOUSLY starting to cry here :-( It's been over a month

RE: reading from socket

2015-09-17 Thread Chris Knipe
oesn't like, which IMHO means something is manipulating / changing the data is some way or form... The above code really is simple, there's no changing of data there -- Chris. -Original Message- From: Brandon McCaig [mailto:bamcc...@gmail.com] Sent: Wednesday, August 1

Re: reading from socket

2015-08-12 Thread Uri Guttman
On 08/12/2015 01:53 PM, Brandon McCaig wrote: Keep in mind that when reading from a socket you're not reading directly from a hard link to the data. There's an entire network of devices that the data has to travel through to arrive at your machine. Lots can happen on the network. P

Re: reading from socket

2015-08-12 Thread Brandon McCaig
On Wed, Aug 12, 2015 at 12:40:29AM +0200, Chris Knipe wrote: > On Wed, Aug 12, 2015 at 12:16 AM, Chris Knipe wrote: > Looking at Data::Dumper - it actually looks like latin1 to me *seriously > confused* > > $VAR1 = > "L\\xAF\\xF3\\xDDWJL\\x94\\xEB\\xB2\\xF8\\xE1\\xACZ\\x89Ul;\\xB7\\xDE}1 > '\\x

Re: reading from socket

2015-08-12 Thread Brandon McCaig
Chris: On Wed, Aug 12, 2015 at 12:16:12AM +0200, Chris Knipe wrote: > > Firstly, if the handle isn't being read with binmode set then > > perhaps the \r\n are being converted to \n (if this is > > Windows)? How are you creating/initializing the socket? > > >

Re: reading from socket

2015-08-11 Thread Jim Gibson
> On Aug 11, 2015, at 3:16 PM, Chris Knipe wrote: > > Lastly, you're reading from a socket so there's no guarantee that > the buffer string is going to necessarily end at the termination > boundary. Perhaps the protocol guarantees that, but the socket > surely doesn

Re: reading from socket

2015-08-11 Thread Chris Knipe
On Wed, Aug 12, 2015 at 12:16 AM, Chris Knipe wrote: > Lines *should* be terminated by CRLF (provided the 8-bit encoding doesn't > mess up the detection), and the entire data stream is then terminated with > a CRLF.CRLF (similar to a SMTP message for example in terms of protocol). > Looking at

Re: reading from socket

2015-08-11 Thread Chris Knipe
> > Firstly, if the handle isn't being read with binmode set then > perhaps the \r\n are being converted to \n (if this is Windows)? > How are you creating/initializing the socket? > Unfortunately, with or without binmode, there's no difference to the matching (from

Re: reading from socket

2015-08-11 Thread Chris Knipe
On Tue, Aug 11, 2015 at 5:28 PM, John SJ Anderson wrote: > On Tue, Aug 11, 2015 at 6:58 AM, John SJ Anderson > wrote: > >> On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe >> wrote: >> >>> >>> >>> my $numBytesToRead = 512; >>> >>> my $buffer; >>> >>> while ($bytesRead = read($TCPSocket, $buffer, $n

Re: reading from socket

2015-08-11 Thread John SJ Anderson
On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe wrote: > > > my $numBytesToRead = 512; > > my $buffer; > > while ($bytesRead = read($TCPSocket, $buffer, $numBytesToRead)) { > > if ($buffer =~ m/\r\n\.\r\n$/) { > > print $buffer; > > last; > > } > > } > > > > I’m obviously doing this wron

Re: reading from socket

2015-08-11 Thread John SJ Anderson
On Tue, Aug 11, 2015 at 6:58 AM, John SJ Anderson wrote: > On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe wrote: > >> >> >> my $numBytesToRead = 512; >> >> my $buffer; >> >> while ($bytesRead = read($TCPSocket, $buffer, $numBytesToRead)) { >> >> if ($buffer =~ m/\r\n\.\r\n$/) { >> >> print $

Re: reading from socket

2015-08-11 Thread Brandon McCaig
Chris: On Tue, Aug 11, 2015 at 02:24:13PM +0200, Chris Knipe wrote: > Hi All, Hello, > I'm reading "binary" from a socket, and just like a normal email message on > the SMTP protocol (for example), the data is terminated by \r\n.\r\n > > > > I'm say

reading from socket

2015-08-11 Thread Chris Knipe
Hi All, I'm reading "binary" from a socket, and just like a normal email message on the SMTP protocol (for example), the data is terminated by \r\n.\r\n I'm saying "binary" because the data stream does include yEnc data (or character codes > 127) I

Re: IO::Socket

2014-12-29 Thread Brandon McCaig
Mike: On Mon, Dec 29, 2014 at 10:23:00AM -0600, Mike wrote: > Can anyone point me in the direction of more thorough > documentation for the IO::Socket module? Seems like the > documentation on perl.org is pretty limited. At least, it > doesn't feel very thorough

Re: IO::Socket

2014-12-29 Thread Andrew Solomon
This might be a good place to start: https://metacpan.org/pod/Socket On Mon, Dec 29, 2014 at 4:23 PM, Mike wrote: > Can anyone point me in the direction of more thorough documentation for the > IO::Socket module? Seems like the documentation on perl.org is pretty > limited. At least, i

IO::Socket

2014-12-29 Thread Mike
Can anyone point me in the direction of more thorough documentation for the IO::Socket module? Seems like the documentation on perl.org is pretty limited. At least, it doesn't feel very thorough to me. http://perldoc.perl.org/IO/Socket.html For example, what exactly does "timeo

Re: How to create a socket file?

2014-01-08 Thread Manfred Lotz
note is that the server program appears to live the special file > of the UNIX domain socket hanging around the filesystem after I press > Ctrl+C (at least here on Mageia Linux x86-64 4). Not sure how to > properly handle it. > > Regards, > > Shlomi Fish > In my s

Re: How to create a socket file?

2014-01-08 Thread Shlomi Fish
On Wed, 8 Jan 2014 13:32:49 +0100 Manfred Lotz wrote: > Hi Shlomi, > > Thanks a lot. This is exactly what I was after. > Hi Manfred, you are welcome. One note is that the server program appears to live the special file of the UNIX domain socket hanging around the filesystem a

Re: How to create a socket file?

2014-01-08 Thread Manfred Lotz
red Lotz wrote: > > > Hi there, > > For test purposes I want to create a socket file. Something I could > > list via ls -l. That's all I want to achieve. > > > > As I didn't find any utility to create a socket file my hope is that > > Perl offers s

Re: How to create a socket file?

2014-01-08 Thread Shlomi Fish
Hi Manfred, Please reply to list if it's a mailing list post - http://shlom.in/reply . On Wed, 8 Jan 2014 11:42:45 +0100 Manfred Lotz wrote: > Hi there, > For test purposes I want to create a socket file. Something I could > list via ls -l. That's all I want to achieve. &g

How to create a socket file?

2014-01-08 Thread Manfred Lotz
Hi there, For test purposes I want to create a socket file. Something I could list via ls -l. That's all I want to achieve. As I didn't find any utility to create a socket file my hope is that Perl offers something to do this. Any idea? -- Manfred -- To unsubscribe, e-mail:

issue with threaded IO::Socket::INET

2013-05-19 Thread Chris Knipe
Hi All, I have an issue with a small piece of code. I am using IO::Socket::INET to accept client connections from an socket, and then hand the connection off to an newly created thread. As soon as an client disconnects (or interrupts the tcp session), the script will exit completely. No errors

IO::Socket::SSL replacement for IO::Socket::INET

2013-04-08 Thread Chris Knipe
Hi All, I've successfully written quite an big perl server using IO::Socket::INET - it seems to be working pretty darn good and so far I'm happy. I'm attempting now to do the same but by using SSL. I've read up on IO::Socket::SSL, and I know that there are minor changes requ

Re: Line-oriented socket I/O using select()

2013-01-14 Thread Vic Sage
ients. I'm >> sure I could work out the logic to maintain application-level buffers, but I >> suspect I would merely be reinventing the wheel, one bug at a time :-). >> What does the experienced Perl programmer - or socket-level programmer in >> general - do in t

RE: Line-oriented socket I/O using select()

2013-01-14 Thread Bob McConnell
o block until an entire "\n"-terminated string [can that be > referred to as a "line"?] can be retrieved from one of my clients. I'm sure > I > could work out the logic to maintain application-level buffers, but I suspect > I > would merely be reinventing t

Re: Line-oriented socket I/O using select()

2013-01-13 Thread Charles DeRykus
> What I *want* is to block until an entire "\n"-terminated string [can that be > referred to as a "line"?] can be retrieved from one of my clients. I'm sure > I could work out the logic to maintain application-level buffers, but I > suspect I would merely be

Line-oriented socket I/O using select()

2013-01-13 Thread Vic Sage
e retrieved from one of my clients. I'm sure I could work out the logic to maintain application-level buffers, but I suspect I would merely be reinventing the wheel, one bug at a time :-). What does the experienced Perl programmer - or socket-level programmer in general - do in t

Re: socket port

2012-09-02 Thread Chris Stinemetz
Thank you so much Jim. -Chris

Re: socket port

2012-09-02 Thread Jim Gibson
On Aug 30, 2012, at 6:46 AM, Chris Stinemetz wrote: > Hello List, > > I am creating a program, where for the first time, I will be reading > in data from a socket port. > > I am a bit confused about how to print the processed data while still > reading in data from the p

Re: socket port

2012-09-02 Thread Chris Stinemetz
Thank you Peng. Are there any other suggestions from the list? Thanks in advance, Chris

Re: socket port

2012-08-30 Thread Peng Yonghua
You might take a look at AnyEvent Intro: http://search.cpan.org/~mlehmann/AnyEvent-7.02/lib/AnyEvent/Intro.pod 在 2012-8-30,下午9:46, Chris Stinemetz 写道: > Hello List, > > I am creating a program, where for the first time, I will be reading > in data from a socket port. > > I

socket port

2012-08-30 Thread Chris Stinemetz
Hello List, I am creating a program, where for the first time, I will be reading in data from a socket port. I am a bit confused about how to print the processed data while still reading in data from the port. Thus far, I have only processed data from a file where the while loop ends when EOF

Re: Passing socket descriptor between threads

2012-08-06 Thread William Ward
It looks like I may have answered my previous question. % cat listener_test #!/usr/bin/perl use strict; use threads; use IO::Socket; my $port = 11444; my $listener_thread = threads->new(\&listener); $listener_thread->join(); sub listener {         my $listening_socket = IO::Socket:

Passing socket descriptor between threads

2012-08-02 Thread William Ward
Hi All, Is there a way to pass a "socket descriptor" to another thread?   Here is an example of what is being attempted here: #!/usr/bin/perl use strict; use threads; use Socket; my $listener_thread = threads->new(\&listener); $listener_thread->join; sub listen

Re: IO::Socket::SSL and SSL_verify_mode

2012-03-21 Thread ml
my error in my server script is Can't use an undefined value as a symbol reference at server.pl ligne 412 ligne 412 is $flags = fcntl($socket, F_GETFL, 0)or die "Can't get flags for socket: $!\n"; Please explain me clearly Le jeudi 22 mars 2012 à 01:45 +0100, ml a écrit

Re: IO::Socket::SSL and SSL_verify_mode

2012-03-21 Thread ml
and though I can walk to my client and server with 0x00 when i put another value of 0x02 0x03 0x04 my script fails at the function #- # nonblock($socket) puts socket into nonblocking mode sub nonblock { my $socket

Re: IO::Socket::SSL and SSL_verify_mode

2012-03-21 Thread Bob goolsby
What was wrong with the answer you received on Perl Monks? 2012/3/21 ml : > hello list > hello guru of perl > hello all > > > I seek to understand how to position the value SSL_verify_mode => 0x00. > >        can you explain how to properly use this parameter

IO::Socket::SSL and SSL_verify_mode

2012-03-21 Thread ml
hello list hello guru of perl hello all I seek to understand how to position the value SSL_verify_mode => 0x00. can you explain how to properly use this parameter in IO::Socket::SSL thank for reply sincerely -- http://pgp.mit.edu:11371/pks/lookup

Re: research for secure tchat client server use IO::Socket::SSL

2012-02-15 Thread ml
to consult the documentation that is different and both PerlMonks different pages that deal with this vast subject. I try to find a minimal example because I want to turn into non securise securise. here is the status of my research #!/usr/bin/perl use warnings; use strict; use IO::Socket::SSL &#

research for secure tchat client server use IO::Socket::SSL

2012-02-15 Thread ml
I want to turn into non securise securise. here is the status of my research #!/usr/bin/perl use warnings; use strict; use IO::Socket::SSL 'inet4'; use threads; use threads::shared; $|++; print "$$ Server started\n"; # do a "top -p -H $$" to monitor server ++

perl question with socket

2011-10-10 Thread 谢成骏
type anything in client.pl and the server.pl will do nothing. So I just add some print for debug, and I can't found my debug message out, so the client.pl just stopped at "print $socket $msg_out", when I use the ctrl+c to quit (p.s. I use archlinux), the server will show the debug mess

Re: Net::SSLeay with Socket or IO::Socket::SSL

2011-08-02 Thread m...@smtp.fakessh.eu
Le mercredi 3 août 2011 02:12, Uri Guttman a écrit : > >>>>> "mfe" == ml@smtp fakessh eu writes: > > mfe> in the examples of Net::SSLeay, it shows various examples that > mfe> use low-level functions use Socket. what are the differences if > m

Re: Net::SSLeay with Socket or IO::Socket::SSL

2011-08-02 Thread Uri Guttman
>>>>> "mfe" == ml@smtp fakessh eu writes: mfe> in the examples of Net::SSLeay, it shows various examples that mfe> use low-level functions use Socket. what are the differences if mfe> we re writing the examples with IO::Socket::SSL just use IO::Socket

Net::SSLeay with Socket or IO::Socket::SSL

2011-08-02 Thread m...@smtp.fakessh.eu
hi folks hi guru of perl in the examples of Net::SSLeay, it shows various examples that use low-level functions use Socket. what are the differences if we re writing the examples with IO::Socket::SSL all testimonials are welcome --  http://pgp.mit.edu:11371/pks/lookup?op=get&se

Re: Wanted: Example of asynchronous bidirectional socket client (a socket chat program)

2011-07-29 Thread C.DeRykus
On Jul 27, 10:07 am, siegfr...@heintze.com wrote: > Sorry if this appears twice. Since it bounced back to me -- probably > because of the HTML format -- I'm sending it again. > > I did some google searching and I could not find an example of a > bidirectional asynchronous soc

Re: Wanted: Example of asynchronous bidirectional socket client (a socket chat program)

2011-07-27 Thread Jim Gibson
xample of a > bidirectional asynchronous socket client. A telnet client is an example > of a bidirectional asynchronous socket client. > > I don't specifically want source to a telnet client -- that would be > much fancier than what I require and would not be helpful if the perl > on

Wanted: Example of asynchronous bidirectional socket client (a socket chat program)

2011-07-27 Thread siegfried
Sorry if this appears twice. Since it bounced back to me -- probably because of the HTML format -- I'm sending it again. I did some google searching and I could not find an example of a bidirectional asynchronous socket client. A telnet client is an example of a bidirectional asynchronous s

Re: Help on a socket problem FIX

2011-02-28 Thread Ted Mittelstaedt
dule. but your last post was jusy about crappy low level socket stuff and that bothered me more. that isn't even a rewrite or changing the logic. it was one line to replace about 10 hard to fix lines. drop in replacement is not a rewrite. Ah, but that same template problem appeared in the

Re: Help on a socket problem

2011-02-25 Thread shawn wilson
You want quick and dirty? Figure out how the nntp module works. Then figure out at what point your program is calling that function and with what parameters. Then replace that function with yours. Then figure out what the program is looking for for output and fix the output that the Net::NNTP modul

Re: Help on a socket problem

2011-02-24 Thread Ted Mittelstaedt
On 2/24/2011 2:00 AM, John W. Krahn wrote: Ted Mittelstaedt wrote: On 2/23/2011 11:32 PM, John W. Krahn wrote: Ted Mittelstaedt wrote: Think of this as a chance to educate. If you were teaching a math class in elementary school and a child asked how to add 2 + 2 would you tell them to get a c

Re: Help on a socket problem FIX

2011-02-24 Thread Ted Mittelstaedt
scription of what it does is available here: http://www.linuxjournal.com/article/2057 it basically pads out the binary data that is being fed to the connect() function to the correct length for the 16 byte binary structure connect() uses. The Perl connect() function requires SOCKET, NAME. In the code the au

Re: Help on a socket problem FIX

2011-02-24 Thread Uri Guttman
to rewrite this code the correct way would be to use TM> one of the NNTP Perl modules (NNTP Client for example) The listgroups TM> script could probably be replaced by something along the lines of s/your/you're/ and i know about using the nntp module. but your last post was j

Re: Help on a socket problem FIX

2011-02-24 Thread John W. Krahn
Ted Mittelstaedt wrote: OK since nobody helped me (sniff, sniff) I had to figure it out myself. Here is the problem code in the fragment: $sockaddr = 'S n a4 x8'; replacing it with $sockaddr = 'x C n a4 x8'; fixed the problem. The template for the pack command was wrong. Th first two bytes

Re: Help on a socket problem

2011-02-24 Thread John W. Krahn
Ted Mittelstaedt wrote: On 2/23/2011 11:32 PM, John W. Krahn wrote: Ted Mittelstaedt wrote: Think of this as a chance to educate. If you were teaching a math class in elementary school and a child asked how to add 2 + 2 would you tell them to get a calculator? The NNTP protocol is very simple

Re: Help on a socket problem FIX

2011-02-24 Thread Ted Mittelstaedt
On 2/24/2011 12:42 AM, Uri Guttman wrote: "TM" == Ted Mittelstaedt writes: TM> $sockaddr = 'x C n a4 x8'; TM> Th first two bytes are length (0) and family, both of which are TM> unsigned char, so 'x C' (or 'n') h

Re: Help on a socket problem

2011-02-24 Thread Ted Mittelstaedt
On 2/23/2011 11:32 PM, John W. Krahn wrote: Ted Mittelstaedt wrote: Think of this as a chance to educate. If you were teaching a math class in elementary school and a child asked how to add 2 + 2 would you tell them to get a calculator? The NNTP protocol is very simple and this only uses a few

Re: Help on a socket problem FIX

2011-02-24 Thread Uri Guttman
>>>>> "TM" == Ted Mittelstaedt writes: TM> $sockaddr = 'x C n a4 x8'; TM> Th first two bytes are length (0) and family, both of which are TM> unsigned char, so 'x C' (or 'n') handles those. TM> use Socket; TM&

Re: Help on a socket problem FIX

2011-02-24 Thread Ted Mittelstaedt
two bytes are length (0) and family, both of which are unsigned char, so 'x C' (or 'n') handles those. I got this from a similar socket problem posting dug out of a mailing list posting from 2003. Perhaps a better way to fix this would be to rewrite it to do something like:

Re: Help on a socket problem

2011-02-23 Thread John W. Krahn
Ted Mittelstaedt wrote: Think of this as a chance to educate. If you were teaching a math class in elementary school and a child asked how to add 2 + 2 would you tell them to get a calculator? The NNTP protocol is very simple and this only uses a few of it's commands. The code works on older Fr

Re: Help on a socket problem

2011-02-23 Thread Ted Mittelstaedt
ng then fail, but this just exits immediately, like it can't create the socket. It can create the socket, but the socket cannot connect to the server socket. I know the code is a decade old and probably isn't the recommended way of doing things nowadays but we want to upgrade the ser

Re: Help on a socket problem

2011-02-23 Thread Jim Gibson
server? ping Those will tell you if it is a connectivity problem. I've tried this on several FreeBSD systems and get the same problem on all of them. If it was a firewall thing I would expect the code to hang then fail, but this just exits immediately, like it can't create the

Help on a socket problem

2011-02-23 Thread Ted Mittelstaedt
x27;, $1, $2, $3, $4); } else { if ($newshost =~ /(\w+)(\.\w+)*/) { ($name, $aliases, $type, $len, $thataddr) = gethostbyname ($newshost); } else { print "Error: NNTP host not specified in proper format\n"; exit 1; } } # get socket

IO::Socket::INET and 255.255.255.255

2011-02-18 Thread Brian J. Murrell
If I change the target from 255.255.255.255 to a unicasted address, my perl process does get the response. Here's how I'm creating my socket and sending and receiving: $handle = IO::Socket::INET->new(Proto => 'udp', Broadcast => 1,

Re: Lighttpd + FCGI = Socket not closing?

2011-01-24 Thread C.DeRykus
there with an > open file descriptor to the socket. > > There are not a child process > anymore and are only killable. > > Here some code: > > #!/usr/bin/perl > > use > strict; > use warnings; > > use FCGI; > > my $handling_request = 0; > my

Lighttpd + FCGI = Socket not closing?

2011-01-21 Thread perl-list
Hi there, I'm using the FCGI module (version 0.67) and a lighttpd to create an imageserver. But currently I have the problem that if I shutdown the lighttpd server, the perl processes are still there with an open file descriptor to the socket. There are not a child process anymore an

Perl and socket communication to interface with O/S commands

2010-10-18 Thread WayneB
Greetings, I setup a menu to connect form an operator's Unix account to my VMS Server. A menu is displayed, and as long as my menu options do not require a response form the operator the commands and the information returned to the operator work fine. Where I have an issue is when I am trying t

Re: IO::Socket operations

2010-09-28 Thread Shlomi Fish
Hi Anand, On Tuesday 28 September 2010 06:52:26 Anand Parthiban wrote: > Dear Team, > > I am a newbie to PERL, See http://perl.org.il/misc.html#pl_vs_pl . > > I was studying about the Socket programming in perl and I was Doing a > Sample Programs using IO::Socket > >

Re: IO::Socket operations

2010-09-28 Thread Jeff Pang
nn>; } etc. You may want to buy the book "Network Programming with Perl" for any detail about socket programming. Jeff. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

IO::Socket operations

2010-09-28 Thread Anand Parthiban
Dear Team, I am a newbie to PERL, I was studying about the Socket programming in perl and I was Doing a Sample Programs using IO::Socket I have Written a Sample Server Client program and it works great, Now, the Problem is that the server is able to listen on Some ports and when the client

Re: Flip-flop conversations using Socket

2010-09-02 Thread Chap Harrison
On Sep 2, 2010, at 3:51 PM, Uri Guttman wrote: > > don't use that. use IO::Socket which is higher level and much easier to use. > It sure is! Thank you. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Flip-flop conversations using Socket

2010-09-02 Thread Uri Guttman
for one-way data transfer, but I need the server to be able to receive some request parameters and then respond to them. CH> --- CH> use Socket; don't use that. use IO::Socket which is higher level and much easier to use. CH> $| = 1; # force a fflush after every

Flip-flop conversations using Socket

2010-09-02 Thread Chap Harrison
some request parameters and then respond to them. Code fragment illustrating how I'm sending lines of data: --- use Socket; $| = 1; # force a fflush after every print my $servername = 'localhost'; my $port = ; my $proto = getprotobyname('tcp'); my $iaddr = ine

Re: Perl; socket

2010-04-10 Thread Uri Guttman
$PORT = $opt{'p'}; Nz> if ( not $PORT ) { Nz>print "You need to apply a port number"; Nz>usage(); Nz>exit 1; Nz> } put all that arg processing into a sub. it makes it easier to manage and also to read the code. i call it process_options() and

Perl; socket

2010-04-10 Thread Niko zuna
Hi, I have made a TCP socket, both a server and a client, and it works just fine, except from the fact that I cant receive more than one input line from the server when I execute a Unix command trough the socket. And when I am trying to send a ps command from the client to the server to count how

RE: Connecting to a socket

2010-03-31 Thread walt
ge- From: Rene Schickbauer [mailto:rene.schickba...@gmail.com] Sent: 31 March 2010 18:46 To: walt; Perl Beginners Subject: Re: Connecting to a socket walt wrote: > Thanks Rene, > > I already have an SMTP server running and have been using it with ASP and > CDOSYS. Works like a charm but it'

Re: Connecting to a socket

2010-03-31 Thread Rene Schickbauer
here you probably have to implement spooling, sender notifications, the lot. Before re-inventing the wheel, at least take a look into http://search.cpan.org For your specific problem, at least the socket part, you might wanna take a look into Net::SMTP. It's still pretty lowlevel, but does so

RE: Connecting to a socket

2010-03-31 Thread Bob McConnell
e got a script or can point me in the right direction? > > A simple example on how to work with sockets can be found here: > <http://www.osix.net/modules/article/?id=441> > > (just google for: perl io::socket tutorial) > > As for the protocol, Wikipedia has a good

Re: Connecting to a socket

2010-03-31 Thread Rene Schickbauer
example on how to work with sockets can be found here: <http://www.osix.net/modules/article/?id=441> (just google for: perl io::socket tutorial) As for the protocol, Wikipedia has a good article on that, look especially at the included example: <http://en.wikipedia

RE: Connecting to a socket

2010-03-31 Thread walt
gain, Walter From: Deborah Martin [mailto:deborah.mar...@kognitio.com] Sent: 31 March 2010 14:47 To: 'walt' Subject: RE: Connecting to a socket Importance: High Walter, You could adapt the following program :- #!/usr/bin/perl # Simple email program us

Re: Connecting to a socket

2010-03-31 Thread Jeff Peng
On Wed, Mar 31, 2010 at 9:39 PM, walt wrote: > Hi, > > I am new to Perl and want to connect to an smtp server on port 25 and then > send it the helo, mail from:, rcpt to:, data, commands but I would also like > to evaluate the response from the smtp server. > > Has anyone got a script or can point

Connecting to a socket

2010-03-31 Thread walt
Hi, I am new to Perl and want to connect to an smtp server on port 25 and then send it the helo, mail from:, rcpt to:, data, commands but I would also like to evaluate the response from the smtp server. Has anyone got a script or can point me in the right direction? I know I could use mailman or

Re: POE with IO::Socket

2009-11-02 Thread Brian J. Miller
Someone Something wrote: How about threading? How hard is it? Where can I find a good tutorial? See "Starting Points" on the home page here: http://poe.perl.org/ Also note there is a mailing list specifically for POE related questions where you may get more help. -- Brian J. Miller End Po

Re: POE with IO::Socket

2009-11-01 Thread Someone Something
n #perl on freenode and they directed me to POE. > > Can I implement POE without changing all my code which is based on > > IO::Socket::INET? > > No, you'll have to change pretty much all of it. Some of the "business > logic" layer will survive. > > POE is a r

  1   2   3   4   5   >