RE: Using UNIX domain sockets

2024-01-15 Thread Claude Brown via beginners
t: Tuesday, January 16, 2024 6:26 AM To: beginners@perl.org Subject: Using UNIX domain sockets CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. Hi, I am trying to control mpv player

Using UNIX domain sockets

2024-01-15 Thread listas.correo
Hi, I am trying to control mpv player using unix sockets but it looks like that perl is unable to send the string correctly. I run the following command: mpv --input-ipc-server=~/mpv.sock --idle=yes -v -v If I sent the string using system commands: $ echo '{"command":[&q

Re: reading from (TCP) sockets

2017-08-12 Thread Chas. Owens
Sockets cannot tell you how much data will come in any language. You HAVE to rely on Content-Length, that is what it is for. Why do you think "It doesn´t seem wise to rely [it]"? It is not possible for a loop to both be blocking (which means it is using no CPU until signaled there is

reading from (TCP) sockets

2017-08-12 Thread hw
I couldn´t find a documentation about using sockets which isn´t anything but confusing and leaves lots of questions. I also guess I need something event-driven, i. e. send a request, and in the event that the server sends data, somehow receive it in the background. The application would need to do

Re: Sockets getting stuck

2015-10-13 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Brandom. On Tue, 13 Oct 2015 10:08:27 -0400 Brandon McCaig wrote: > On Tue, Oct 13, 2015 at 6:34 AM, David Emanuel da Costa Santiago > wrote: > > Hi! > > Hello, > > > THanks for your suggestion. > > I assume this was off-list because

Re: Sockets getting stuck

2015-10-13 Thread Brandon McCaig
of time, or exit 1. Perhaps your troubles aren't code and are instead network stability. If your network isn't stable enough to receive the packets then there isn't much you can do within software to fix it. Unless you need socket-level access consider using a higher-level network pro

Re: Sockets getting stuck

2015-10-13 Thread David Emanuel da Costa Santiago
2015 20:50:46 -0700 $Bill wrote: > This failed twice to post - emailing it. > > On 10/12/2015 09:58, David Emanuel da Costa Santiago wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > > > Hello all! > > > > I'm creating s

Re: Sockets getting stuck

2015-10-12 Thread David Emanuel da Costa Santiago
ocket simply gets in zombie state. Not dead, but not alive. The connection timeout doesn't work, the receive timeout (SO_RCVTIMEO) and send timeout (SO_SNDTIMEO) does work. Is there any way to recover from this? On Mon, 12 Oct 2015 18:58:42 +0200 David Emanuel da Costa Santiago wrote: >

Sockets getting stuck

2015-10-12 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello all! I'm creating some sockets to a remote server and from time to time, the sockets get "frozen". I'm creating the socket as: $socket = IO::Socket::INET->new (

Re: blocking sockets?

2012-02-07 Thread Jim Gibson
from the remote client,. How can I accomplish that the server still responds to incoming requests on port 1234 but also sends its commands over the other socket to port 4321? You have basically three options for reading and writing from/to multiple sockets simultaneously: 1. Non-blocking

Re: blocking sockets?

2012-02-07 Thread Brandon McCaig
nt something > above... All I want to accomplish is talking over 2 (or more) > sockets without the server hanging itself on one of the > sockets. > > Any help with examples or pointers in the right direction is > appreciated! I used IO::Select for bambot[1]. I use it to detect whet

blocking sockets?

2012-02-06 Thread Marco van Kammen
I've found some people talking about IO::Socket:Select but I'm unable to find a simple example of how to implement something above... All I want to accomplish is talking over 2 (or more) sockets without the server hanging itself on one of the sockets. Any help with examples or pointers

Re: Sockets

2010-10-08 Thread Uri Guttman
> "JB" == Jonas Bull writes: JB> use POSIX qw|setsid|; JB> use Getopt::Long; JB> use Socket; that module is not needed. JB> use IO::Socket; JB> use threads; JB> use threads::shared; JB> use IO::Select; JB> ## options from cli #

Sockets

2010-10-08 Thread Jonas Bull
Programming sockets for a persistent service is something relatively new to me. Here is the main part of the program as it stands: use POSIX qw|setsid|; use Getopt::Long; use Socket; use IO::Socket; use threads; use threads::shared; use IO::Select; ## options from

RE: Perl not closing TCP sockets if clients are no longer connected?

2010-04-28 Thread Bob McConnell
lmeyer.blt...@gmail.com] Sent: Wednesday, April 28, 2010 3:29 PM To: beginners@perl.org Subject: Perl not closing TCP sockets if clients are no longer connected? The purpose of the application is to listen for a specific UDP multicast and then to forward the data to any TCP clients connected to the server

Perl not closing TCP sockets if clients are no longer connected?

2010-04-28 Thread Leon Meyer
The purpose of the application is to listen for a specific UDP multicast and then to forward the data to any TCP clients connected to the server. The code works fine, but I have a problem with the sockets not closing after the TCP clients disconnects. A socketsniffer utility shows the the sockets

Thread Queues and Sockets

2010-04-13 Thread Iker Perez de Albeniz Villarroel
Hi, I am having problems creating a multithread queued Server because i can not enqueue sockets.. For example is not possible to make something like this.. my $Qwork = new Thread::Queue; our $server = new Net::SMTP::Server($host) || while(my $conn = $server->accept()) { $Qw

RE: Reading from multiple sockets.

2008-11-02 Thread Kammen van, Marco, Springer SBM NL
-Original Message- From: kenTk [mailto:[EMAIL PROTECTED] Sent: Saturday, November 01, 2008 10:41 PM To: beginners@perl.org Subject: Re: Reading from multiple sockets. On Oct 30, 8:33 am, [EMAIL PROTECTED] (Kammen van) wrote: > >>> From: Peter Scott [mailto:[EMA

Re: Reading from multiple sockets.

2008-11-02 Thread kenTk
On Oct 30, 8:33 am, [EMAIL PROTECTED] (Kammen van) wrote: > >>> From: Peter Scott [mailto:[EMAIL PROTECTED] > >>> Subject: Re: Reading from multiple sockets. > > >> On Tue, 21 Oct 2008 12:53:53 +0200, Kammen van, Marco, Springer SBM > NL > >> wrote

RE: Reading from multiple sockets.

2008-10-30 Thread Kammen van, Marco, Springer SBM NL
>>> From: Peter Scott [mailto:[EMAIL PROTECTED] >>> Subject: Re: Reading from multiple sockets. > >> On Tue, 21 Oct 2008 12:53:53 +0200, Kammen van, Marco, Springer SBM NL >> wrote: >> I'm pretty new to working with sockets in perl, looked around for

RE: Reading from multiple sockets.

2008-10-23 Thread Kammen van, Marco, Springer SBM NL
Kammen van, Marco, Springer SBM NL wrote: > >>> From: Peter Scott [mailto:[EMAIL PROTECTED] >>> Subject: Re: Reading from multiple sockets. > >> On Tue, 21 Oct 2008 12:53:53 +0200, Kammen van, Marco, Springer SBM NL >> wrote: >> I'm pretty new

RE: Reading from multiple sockets.

2008-10-23 Thread Kammen van, Marco, Springer SBM NL
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2008 2:51 PM To: Perl Beginners Subject: Re: Reading from multiple sockets. Kammen van, Marco, Springer SBM NL wrote: > >>> From: Peter Scott [mailto:[EMAIL PROTECTED] >

Re: Reading from multiple sockets.

2008-10-22 Thread John W. Krahn
Kammen van, Marco, Springer SBM NL wrote: From: Peter Scott [mailto:[EMAIL PROTECTED] Subject: Re: Reading from multiple sockets. On Tue, 21 Oct 2008 12:53:53 +0200, Kammen van, Marco, Springer SBM NL wrote: I'm pretty new to working with sockets in perl, looked around for days for a p

RE: Reading from multiple sockets.

2008-10-22 Thread Kammen van, Marco, Springer SBM NL
>>From: Peter Scott [mailto:[EMAIL PROTECTED] >>Subject: Re: Reading from multiple sockets. >On Tue, 21 Oct 2008 12:53:53 +0200, Kammen van, Marco, Springer SBM NL >wrote: > I'm pretty new to working with sockets in perl, looked around for days > for a proper so

Re: Reading from multiple sockets.

2008-10-22 Thread Peter Scott
On Tue, 21 Oct 2008 12:53:53 +0200, Kammen van, Marco, Springer SBM NL wrote: > I'm pretty new to working with sockets in perl, looked around for days > for a proper solution for my IRC/DCC problem but couldn't find one. If you'd like to do this without grubbing around at th

RE: Reading from multiple sockets.

2008-10-21 Thread Kammen van, Marco, Springer SBM NL
-Original Message- From: Bob McConnell [mailto:[EMAIL PROTECTED] > Which I forgot to mention is that both my sockets are connected to > different ports... (54321 & 1024) > And also, one socket is connected to a server, and the other socket is > accepting from a client.

RE: Reading from multiple sockets.

2008-10-21 Thread Bob McConnell
From: Kammen van, Marco, Springer SBM NL >>Hi All! >> >>I'm pretty new to working with sockets in perl, looked around for days >>for a proper solution for my IRC/DCC problem but couldn't find one. >> >>The connection to the server uses a socket with a

RE: Reading from multiple sockets.

2008-10-21 Thread Kammen van, Marco, Springer SBM NL
>Hi All! > >I'm pretty new to working with sockets in perl, looked around for days >for a proper solution for my IRC/DCC problem but couldn't find one. > >The connection to the server uses a socket with a neverending while >loop: >All works fine untill i w

Reading from multiple sockets.

2008-10-21 Thread Kammen van, Marco, Springer SBM NL
Hi All! I'm pretty new to working with sockets in perl, looked around for days for a proper solution for my IRC/DCC problem but couldn't find one. The connection to the server uses a socket with a neverending while loop: sub connection { # Make The Initial Server Connection! #

Re: Perl Sockets oddity..

2008-09-24 Thread Andy Dixon
On 24 Sep 2008, at 15:44, Rob Dixon wrote: Andy Dixon wrote: I may be being a bit dim, but I wrote this: #!/usr/bin/perl -w use IO::Socket::INET; print "ISONAS Logger (perl) v1\n"; my $socket = IO::Socket::INET->new( PeerAddr => "10.9.1.100", Pe

Re: Perl Sockets oddity..

2008-09-24 Thread Deviloper
meh

Re: Perl Sockets oddity..

2008-09-24 Thread Rob Dixon
Deviloper wrote: > > If I were in your place, I would use Data::Dumper or a IDE with a grafical > debugger and take a look what happens. try the 30 Days Trail of Komodo Pro > Studio > IDE or OptiPerl is you don´t like data::dumper. > > Try in your while loop > > m

Re: Perl Sockets oddity..

2008-09-24 Thread Deviloper
; > > > } > > > > do > > > > > > while ($socket->recv($text,128)) { > > > >          print $text; > > > > } > > > > Byebye, > > Bo > > > > Stewart Anderson <[EMAIL PROTECTED]> hat am 24. 

Re: Perl Sockets oddity..

2008-09-24 Thread Rob Dixon
Andy Dixon wrote: > > I may be being a bit dim, but I wrote this: > > #!/usr/bin/perl -w > use IO::Socket::INET; > print "ISONAS Logger (perl) v1\n"; > my $socket = IO::Socket::INET->new( > PeerAddr => "10.9.1.100", > PeerPort => "5321" >

Re: Perl Sockets oddity..

2008-09-24 Thread Andy Dixon
tewart Anderson <[EMAIL PROTECTED]> hat am 24. September 2008 um 13:35 geschrieben: > > -Original Message- > > From: Andy Dixon [mailto:[EMAIL PROTECTED] > > Sent: 24 September 2008 12:26 > > To: beginners@perl.org > > Subject: Perl Sockets oddity.. &

RE: Perl Sockets oddity..

2008-09-24 Thread Deviloper
Bo Stewart Anderson <[EMAIL PROTECTED]> hat am 24. September 2008 um 13:35 geschrieben: > > -Original Message- > > From: Andy Dixon [mailto:[EMAIL PROTECTED] > > Sent: 24 September 2008 12:26 > > To: beginners@perl.org > > Subject: Perl

RE: Perl Sockets oddity..

2008-09-24 Thread Stewart Anderson
> -Original Message- > From: Andy Dixon [mailto:[EMAIL PROTECTED] > Sent: 24 September 2008 12:26 > To: beginners@perl.org > Subject: Perl Sockets oddity.. > > Hello, > > I may be being a bit dim, but I wrote this: > > #!/usr/bin/perl -w > use IO::

Perl Sockets oddity..

2008-09-24 Thread Andy Dixon
Hello, I may be being a bit dim, but I wrote this: #!/usr/bin/perl -w use IO::Socket::INET; print "ISONAS Logger (perl) v1\n"; my $socket = IO::Socket::INET->new( PeerAddr => "10.9.1.100", PeerPort => "5321" ) or die $!; prin

Re: Perl Sockets Communications

2008-04-28 Thread John W. Krahn
Richard Luckhurst wrote: Hi List Hello, I have just been given the task of finding out why a perl sockets listener application we have is no longer working correctly. The application was written back in 2002 and I am told worked fine until we were forced to install a new server early this

Perl Sockets Communications

2008-04-28 Thread Richard Luckhurst
Hi List I have just been given the task of finding out why a perl sockets listener application we have is no longer working correctly. The application was written back in 2002 and I am told worked fine until we were forced to install a new server early this year. I have no idea what version of

Re: cannot determine peer address with Unix domain sockets

2007-03-23 Thread Andy Greenwood
tinitialize sub. > Besides, if it wasn't global, wouldn't I be unable to read from it at > all in the checkconnections sub? I can read the list of sockets out of > select. Otherwise, perl would never get down to line 1256 and I would > never get my error, no? > > If you

Re: cannot determine peer address with Unix domain sockets

2007-03-23 Thread John W. Krahn
ouldn't I be unable to read from it at > all in the checkconnections sub? I can read the list of sockets out of > select. Otherwise, perl would never get down to line 1256 and I would > never get my error, no? > > If you want to view the entire script, you can at > http://s

Re: cannot determine peer address with Unix domain sockets

2007-03-23 Thread Andy Greenwood
;use strict'. I'm $Select is global and I am using strict and warnings. It is declared at the top of the program and defined in the socketinitialize sub. Besides, if it wasn't global, wouldn't I be unable to read from it at all in the checkconnections sub? I can read the li

Re: cannot determine peer address with Unix domain sockets

2007-03-22 Thread Jeff Pang
> >Is $Select a global variable? Is that why it's got a capital letter? I >suspect that you're not coding under the rules of 'use strict'. I'm >not sure whether that indicates a problem with your program, but it >bears further investigation. > >Cheers! > >--Tom Phoenix >Stonehenge Perl Training >

Re: cannot determine peer address with Unix domain sockets

2007-03-22 Thread Tom Phoenix
On 3/22/07, Andy Greenwood <[EMAIL PROTECTED]> wrote: $Select = new IO::Select(); Is $Select a global variable? Is that why it's got a capital letter? I suspect that you're not coding under the rules of 'use strict'. I'm not sure whether that indicates a problem with your program, but

Re: cannot determine peer address with Unix domain sockets

2007-03-22 Thread Andy Greenwood
} // close socket @socket_close($socket); // return return $return; } else { // fluxd not running return null; } } end php here's the perl code which creates and reads the sockets -

Re: cannot determine peer address with Unix domain sockets

2007-03-22 Thread Tom Phoenix
On 3/22/07, Andy Greenwood <[EMAIL PROTECTED]> wrote: I am getting the following error whenever I try to send data to a unix domain socket. PHP sends the command just fine, but perl dies as soon as it reads from the socket. Are you using PHP, or Perl? Both? send: Cannot determine peer addres

cannot determine peer address with Unix domain sockets

2007-03-22 Thread Andy Greenwood
I am getting the following error whenever I try to send data to a unix domain socket. PHP sends the command just fine, but perl dies as soon as it reads from the socket. send: Cannot determine peer address at myscript.pl line 1256 I found the following page which discusses a fix for this on Open

Re: Sockets

2006-09-09 Thread Jack Faley ( The Tao of Jack )
On 9/9/06, elite elite <[EMAIL PROTECTED]> wrote: Does anyone know any good links on networking with perl or on sockets? check out docs for IO::Socket How about books? Both at Amazon at the very least: Network Programming with Perl by Lincoln D. Stein, Addison-Wesley Profes

Re: Sockets

2006-09-09 Thread Randal L. Schwartz
>>>>> "elite" == elite elite <[EMAIL PROTECTED]> writes: elite> Does anyone know any good links on networking with elite> perl or on sockets? Are you just curious, or are you inventing a new protocol? Because if you're not either of those, there

Re: Sockets

2006-09-09 Thread jeffhua
Lincoln Stein's great book of 'Network Programming with Perl' is very good for your purpose. -Original Message- From: [EMAIL PROTECTED] To: beginners@perl.org Sent: Sat, 9 Sep 2006 7:56 PM Subject: Sockets Does anyone know any good links on networking with per

Sockets

2006-09-09 Thread elite elite
Does anyone know any good links on networking with perl or on sockets? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Sockets recv question

2005-12-16 Thread Scott
I am working on a sockets based script. My question is what if the length of the recv is likely to change, but you need the following recv lines not to get corrupted? Example $client->recv($bkserv,128); $client->recv($bkuser,128); $client->recv($dumppath,128); $client->recv($dumpnam

Re: Sockets questions

2005-12-03 Thread Octavian Rasnita
From: "Scott" <[EMAIL PROTECTED]> > I recently started messing with perl sockets and I was wondering if it is > possible to do any of the following: > > - Pre-shared key, to act as some sort of authentication. Currently I have > it checking the peer address, but

Sockets questions

2005-12-02 Thread Scott
I recently started messing with perl sockets and I was wondering if it is possible to do any of the following: - Pre-shared key, to act as some sort of authentication. Currently I have it checking the peer address, but I figure that could be spoofed. - Stream large amounts of data, IE tar to

RE: network sockets.

2004-10-14 Thread Bob Showalter
was just wondering what is the difference > and preferred way ? I would strongly recommend IO::Socket over Socket for a production application; the former does a much better job of encapsulating the gory details. (One simple example: it remembers to turn on autoflush for your sockets, which is a

network sockets.

2004-10-14 Thread Etienne Ledoux
greetings, I'm attempting a perl program that will listen on a port for a connection. when a connection is made some info will be transfered and the client will disconnect. I've never done this before but seem to be making some progress with all the resources available on the net. I was just w

Sockets

2004-04-28 Thread JupiterHost.Net
Hello list, I've been playing with sockets a bit lately. I've studied and run this client/server example: http://www.qiksearch.com/articles/perl_sockets.htm I've been looking at http://hotwired.lycos.com/webmonkey/97/18/index2a_page2.html?tw=programming also trying to wrap

RE: Sockets, Why can't I do this?

2004-03-10 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : : I get an unknown error from the command prompt. Care to share the error with us? HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

Sockets, Why can't I do this?

2004-03-10 Thread Motherofperls
I get an unknown error from the command prompt. My goal was to fetch a list of numbers for the socket port. Maybe it's just an XP problem ?? #!perl -w my$hostprog = 'localhost'; if(open(LOG, ">>./log.txt")){ }else{print "Couldn't open LOG";} use IO::Socket; use LWP::Simple; #get a list of socket n

Re: sockets on an HPUX

2004-01-09 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > People of the Perl, Hello, > does anyone have a perl program that will create a socket ( srwxr-xr-x ) > for a HPUX 11.0 system? I am in need of this! I have looked into system > calls such as mknod and mkfifo and these are not capable of creating these > special fi

Re: sockets on an HPUX (thanks for the port scanner!)

2004-01-09 Thread Goffredo Saffioti
McMahon, Chris ha scritto: Thank you Mr. Saffioti for the port-scanning code. I have been playing with some simple network programming scripts recently and your code below is much more elegant than mine. I'll be stealing parts of it very soon! =) -Chris maybe u can better apprecia

RE: sockets on an HPUX (thanks for the port scanner!)

2004-01-09 Thread McMahon, Chris
fredo Saffioti [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:52 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: sockets on an HPUX [EMAIL PROTECTED] ha scritto: >People of the Perl, > >does anyone have a perl program that will create a socket ( srwxr-xr-x ) >for a

Re: Perl sockets on an HPUX

2004-01-09 Thread Goffredo Saffioti
TECTED] Subject:Re: Perl sockets on an HPUX [EMAIL PROTECTED] ha scritto: >People of the Perl, > >does anyone have a perl program that will create a socket ( srwxr-xr-x ) >for a HPUX 11.0 system? I am in need of this! I have looked into system >calls such as mknod and mkf

RE: Perl sockets on an HPUX

2004-01-09 Thread NYIMI Jose (BMB)
PROTECTED] Sent: Friday, January 09, 2004 4:39 PM To: Goffredo Saffioti Cc: [EMAIL PROTECTED] Subject: Re: Perl sockets on an HPUX Great where do I get this IO::Socket module? thank you Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Goffredo Saffioti <[EMAIL PROTECTED]> 01/09/2004 12

Re: Perl sockets on an HPUX

2004-01-09 Thread DBSMITH
Great where do I get this IO::Socket module? thank you Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Goffredo Saffioti <[EMAIL PROTECTED]> 01/09/2004 12:52 PM To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: Perl sockets on a

Re: sockets on an HPUX

2004-01-09 Thread Goffredo Saffioti
[EMAIL PROTECTED] ha scritto: People of the Perl, does anyone have a perl program that will create a socket ( srwxr-xr-x ) for a HPUX 11.0 system? I am in need of this! I have looked into system calls such as mknod and mkfifo and these are not capable of creating these special files. Thank

sockets on an HPUX

2004-01-09 Thread DBSMITH
People of the Perl, does anyone have a perl program that will create a socket ( srwxr-xr-x ) for a HPUX 11.0 system? I am in need of this! I have looked into system calls such as mknod and mkfifo and these are not capable of creating these special files. Thanks! Derek B. Smith OhioHealth

Re: Sockets and Daemonizing - was Re: Count the no of times a script is called

2003-11-27 Thread drieux
On Thursday, Nov 27, 2003, at 01:26 US/Pacific, Tom Kinzer wrote: Not sure, I'm not an admin by trade, but I was actually referring to the fact that some admins assume that user Perl processes that don't die, are doing so unintentionally. Ah! an interesting take. Having been one of those folks who

RE: Sockets and Daemonizing - was Re: Count the no of times a script is called

2003-11-27 Thread Tom Kinzer
om Kinzer Long Beach, California -Original Message- From: drieux [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 2:12 PM To: begin begin Subject: Sockets and Daemonizing - was Re: Count the no of times a script is called On Wednesday, Nov 26, 2003, at 13:28 US/Pacific, T

Sockets and Daemonizing - was Re: Count the no of times a script is called

2003-11-26 Thread drieux
On Wednesday, Nov 26, 2003, at 13:28 US/Pacific, Tom Kinzer wrote: drieux suggests: The alternative of course would be to have the 'perl code' start up as a daemon that handled requests on a socket, this way you would save the 'start up' overhead of invoking a new process each time through. Make s

RE: Sockets

2003-07-17 Thread Kipp, James
> > In the documentation of socket appears the fllowing: > $sockaddr = 'S n a4 x8' > > What means this??? it is a template for packing the generic C socket adr structure. readup on sockets for deeper explanation. the adt string is packed into structure of: a sig

Re: Sockets

2003-07-16 Thread John W. Krahn
"Jose M.Herrera" wrote: > > In the documentation of socket appears the fllowing: > $sockaddr = 'S n a4 x8' > > What means this??? That is a format string to be used with pack() and/or unpack() perldoc -f pack John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED

Sockets

2003-07-16 Thread Jose M.Herrera
In the documentation of socket appears the fllowing: $sockaddr = 'S n a4 x8' What means this??? Thanks... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Help !!! on sockets

2003-07-16 Thread Pandey Rajeev-A19514
eev-A19514; [EMAIL PROTECTED] Subject: RE: Help !!! on sockets > When I print the @buffer outside the while loop , I am not > getting the output. > > Note : The commented line i.e. #print "Server: $_"; works and > prints all the lines read from the socket. > >

RE: Help !!! on sockets

2003-07-16 Thread Kipp, James
> When I print the @buffer outside the while loop , I am not > getting the output. > > Note : The commented line i.e. #print "Server: $_"; works and > prints all the lines read from the socket. > > Please somebody tell me what error have I been making. > > Regards > Rajeev >

Help !!! on sockets

2003-07-16 Thread Pandey Rajeev-A19514
Hi , I have done a silly mistake which am not able to detect. Below is a subroutine, that takes the Socket_Handle and the Message as arguments. First i send the message and then I start reading the Socket in a while loop until DONE is detected. I am pushing each line in a @buffer. When I print

RE: Problems with Sockets

2003-07-16 Thread Kipp, James
> > use IO::Socket; > > $server_port = 514; > > $server = IO::Socket::INET -> new(LocalPort => $server_port, > Proto => "udp") > or die "Couldn't be a udp server on port $server_port : [EMAIL PROTECTED]"; > > while ($him = $server ->recv($datagram, 1024)) { > > ($portn

Problems with Sockets

2003-07-16 Thread Ruben Montes
Hello, I have developed an UDP server and I need to know the ip address of the remote peer. This is the code: use IO::Socket; $server_port = 514; $server = IO::Socket::INET -> new(LocalPort => $server_port, Proto => "udp") or die "Couldn't be a udp server on port $server_port : [EMAIL PROTECTED]

Re: SOCKETS??

2003-07-08 Thread david
"Andre Chaves Mascarenhas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi How do i read a web page with socks? do i send? if SK is a open socjet at port 80 at lets say www.yahoo.com if i send print SK "GET /index.htm HTTP/1.1\n" will i get the www.yahoo.com/index.htm page ? Thanks

SOCKETS??

2003-07-07 Thread Andre Chaves Mascarenhas
Hi How do i read a web page with socks? do i send? if SK is a open socjet at port 80 at lets say www.yahoo.com if i send print SK "GET /index.htm HTTP/1.1\n" will i get the www.yahoo.com/index.htm page ? Thanks

RE: sockets: packing an inet sructure

2003-07-02 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (James Kipp) writes: >$template = 'S n C4 x8'; >$| = 1; >socket(MY_SOCKET, AF_INET, SOCK_STREAM, 0) || die "Socket: $!\n"; > >$addr = (gethostbyname("10.1.101.12"))[4]; >$paddr = pack($template,AF_INET,$port,$addr); >bind(MY_SOCKET, $paddr) || die

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
> > $addr = (gethostbyname("10.1.101.12"))[4]; > > $paddr = pack($template,AF_INET,$port,$addr); > > If you dump out $paddr right here, you'll see that the > address portion is > all zeros, so you're really binding to INADDR_ANY and not to > the specific > address. However, the AF_INET is still

RE: sockets: packing an inet sructure

2003-07-01 Thread Bob Showalter
Kipp, James wrote: > the server is a Intel P3, same as the client. Little endian. I agree, > it shouldn't work, but it does. here is the code: > -- > $port = 6668; > $template = 'S n C4 x8'; > $| = 1; > socket(MY_SOCKET, AF_INET, SOCK_STREAM, 0) || die "Socket: $!\n"; > > $addr = (gethostbyname("1

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
> > > Your template is wrong. You need 'x C n a4 x8' (or 'n n a4 x8'). > > Thanks, I will give that a shot. Altough, all of the docs > that i read > > pack the structure with the 'S n C4 x8' template > > Is that in the Perl docs somewhere? no, they say to use sockaddr_in() of course. docs I foun

RE: sockets: packing an inet sructure

2003-07-01 Thread Bob Showalter
Kipp, James wrote: > > > $template = 'S n C4 x8'; > > > > Your template is wrong. You need 'x C n a4 x8' (or 'n n a4 x8'). > Thanks, I will give that a shot. Altough, all of the docs that i read > pack the structure with the 'S n C4 x8' template Is that in the Perl docs somewhere? The first S wi

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
> > $template = 'S n C4 x8'; > > Your template is wrong. You need 'x C n a4 x8' (or 'n n a4 x8'). Thanks, I will give that a shot. Altough, all of the docs that i read pack the structure with the 'S n C4 x8' template and it does work on the Server end. > The returned value from gethostbyname is

RE: sockets: packing an inet sructure

2003-07-01 Thread Bob Showalter
Kipp, James wrote: > I am trying to hand pack an net addr. On the server end (linux - > i386) it works fine.: > $addr = pack($template,AF_INET,$port,$iaddr); > bind(MY_SOCKET, $addr) || die "$0: Cannot bind .. $!\n"; -- > on the client end (win2k - i386) it fails. > -- > $template = 'S n C4 x8'; Y

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
> > maybe because of big Indian small Indian problem ?? just a > though I never pack'd it my self. good thinking, but the CPU is the same on both machines. It is Endian btw.. :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sockets: packing an inet sructure

2003-07-01 Thread mgoland
maybe because of big Indian small Indian problem ?? just a though I never pack'd it my self. Mark G - Original Message - From: "Kipp, James" <[EMAIL PROTECTED]> Date: Tuesday, July 1, 2003 9:24 am Subject: sockets: packing an inet sructure > I am trying to h

sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
I am trying to hand pack an net addr. On the server end (linux - i386) it works fine.: $addr = pack($template,AF_INET,$port,$iaddr); bind(MY_SOCKET, $addr) || die "$0: Cannot bind .. $!\n"; -- on the client end (win2k - i386) it fails. -- $template = 'S n C4 x8'; $port = 6668; $proto = getprotoby

RE: Sockets....

2002-11-14 Thread Sorrells, Dave
Bingo! Thanks Paul, you are correct. $_ is not getting loaded in the while statement. >someone please poke me if I'm dreaming, but if you say > > while(<$new_sock>) { print $_; } > >the while(<>){} structure automatically loads $_ with whatever came out >of the <> ... IF and ONLY IF the diamond op

RE: Sockets....

2002-11-14 Thread Kipp, James
> Server: > #!/usr/bin/perl > use IO::Socket; > my $sock = new IO::Socket::INET ( > LocalHost => 'IP_GOES_HERE', > (<-- yes this > is set properly) > LocalPort => '6', > Proto => 'tcp', >

Re: Sockets....

2002-11-14 Thread Paul
> no idea if that is correct. Is there something missing, how does $_ > get assigned the input from $new_sock? Thanks. > > while(defined(<$new_sock>)) { >print "Socket defined\n"; >print $_; > } someone please poke me if I'm dreaming, but if you say while(<$new_sock>) { print $_; } t

RE: Sockets....

2002-11-14 Thread Sorrells, Dave
ells, Dave [mailto:Dave.Sorrells@;usa.xerox.com] Sent: Thursday, November 14, 2002 10:53 AM To: '[EMAIL PROTECTED]' Subject: Sockets Hey all, I'm trying to learn a bit about Perl sockets. I got these simple client/server scripts from http://www.perlfect.com/articles/sockets.shtml and I can'

Sockets....

2002-11-14 Thread Sorrells, Dave
Hey all, I'm trying to learn a bit about Perl sockets. I got these simple client/server scripts from http://www.perlfect.com/articles/sockets.shtml and I can't even get them to work. When I run the client against the server I get no output at the server. The "Socket defined" l

Re: Number of open sockets

2002-10-09 Thread saffiot
Jessee Parker wrote: >Is there a way to keep track of the number of open sockets your program might have >that are in a TIME_WAIT (I think it is) state? > > > If you want can trye this script for to track the socket open on the ports feel free for every change that you w

Re: Number of open sockets

2002-10-08 Thread Michael Fowler
On Tue, Oct 08, 2002 at 09:59:16AM -0700, Jessee Parker wrote: > Is there a way to keep track of the number of open sockets your program > might have that are in a TIME_WAIT (I think it is) state? The problem is if a socket is in a TIME_WAIT state it's no longer open by your program.

RE: Number of open sockets

2002-10-08 Thread Kipp, James
you can always parse netstat , and have it refresh (sleep and loop) every few seconds > -Original Message- > From: Jessee Parker [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 08, 2002 12:59 PM > To: [EMAIL PROTECTED] > Subject: Number of open sockets > > >

RE: Number of open sockets

2002-10-08 Thread nkuipers
ep track of the number of open sockets your program might >have that are in a TIME_WAIT (I think it is) state? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

  1   2   >