From holzem at cantv.net Fri Oct 3 05:00:59 2008 From: holzem at cantv.net (Hans Olzem) Date: Fri, 3 Oct 2008 07:30:59 -0430 Subject: [caracas-pm] IO:Socket Message-ID: <20081003073059.1025938a.holzem@cantv.net> Hola mongers, programe un cliente: #!/usr/local/bin/perl -w use Tk; use IO::Socket; use Tk::Button; use integer; use strict; use constant TIMEOUT => 5; my $host = 'localhost'; my $port = '12345'; $sock = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => TIMEOUT) or die "can't connect to $host:$port: $@\n"; $Cmdstrng = "GO\n"; print $sock $Cmdstrng; MainLoop; #Asi mando commandos al servidor: $Cmdstrng = "SET 1 GA 1 1 1 -1\n"; print $sock $Cmdstrng; # Hay commandos a los cuales el servidor responde con informacion: $Cmdstrng = "GET 3 FB 32\n"; print $sock $Cmdstrng; $server_response = ???????????; #Ahora la pregunta: Como tengo accesso a esta repuesta del servidor? #Con telnet funciona bien. Hans -- Hans Olzem From lem at itverx.com.ve Fri Oct 3 05:41:30 2008 From: lem at itverx.com.ve (Luis E. =?ISO-8859-1?Q?Mu=F1oz?=) Date: Fri, 03 Oct 2008 08:11:30 -0430 Subject: [caracas-pm] IO:Socket In-Reply-To: <20081003073059.1025938a.holzem@cantv.net> References: <20081003073059.1025938a.holzem@cantv.net> Message-ID: <1223037690.5481.8.camel@localhost> On Fri, 2008-10-03 at 07:30 -0430, Hans Olzem wrote: > #Ahora la pregunta: Como tengo accesso a esta repuesta del servidor? > #Con telnet funciona bien. IO::Socket es una especializaci?n de IO::Handle, de manera que todos los m?todos de ::Handle est?n disponibles. Esto es, el socket es un filehandle. Puedes leer usando varias f?rmulas. Usa la que te parezca m?s c?moda (este ejemplo es un cliente HTTP m?nimo): ### Usando ->getlines #! /usr/bin/perl use strict; use warnings; use IO::Socket; my $sock = new IO::Socket::INET (PeerAddr => 'localhost:80', Proto => 'tcp') or die "Failed to create socket: $!\n"; print $sock "GET / HTTP/1.0\r\n\r\n" or die "Failed to send: $!\n"; print $_ for $sock->getlines; # O esta variante # print $_ for <$sock>; __END__ Saludos -lem From ait at p2ee.org Sat Oct 4 07:18:57 2008 From: ait at p2ee.org (Alejandro Imass) Date: Sat, 04 Oct 2008 09:48:57 -0430 Subject: [caracas-pm] IO:Socket In-Reply-To: <20081003073059.1025938a.holzem@cantv.net> References: <20081003073059.1025938a.holzem@cantv.net> Message-ID: <1223129937.3448.96.camel@localhost> El fin de linea no es \n (CR) sino \n\r (CR+LF) ASCII HEX DEC OCTAL CR 0x0D 13 015 LF 0x0A 10 012 Si te quieres curar en salud usa \015\012 como fin de linea. (a menos que est?s trabajando en un EBCDIC y quiz?s debas usar NEL ;-)) Referencias: http://es.wikipedia.org/wiki/ASCII http://es.wikipedia.org/wiki/CRLF http://www.onlamp.com/pub/a/onlamp/2006/08/17/understanding-newlines.html http://en.wikipedia.org/wiki/Newline http://en.wikipedia.org/wiki/EBCDIC http://www.w3.org/TR/newline http://www.rfc-editor.org/EOLstory.txt El vie, 03-10-2008 a las 07:30 -0430, Hans Olzem escribi?: > Hola mongers, > > programe un cliente: > > > #!/usr/local/bin/perl -w > use Tk; > use IO::Socket; > use Tk::Button; > use integer; > use strict; > use constant TIMEOUT => 5; > > my $host = 'localhost'; > my $port = '12345'; > > $sock = new IO::Socket::INET( PeerAddr => $host, > PeerPort => $port, > Proto => 'tcp', Timeout => TIMEOUT) > or die "can't connect to $host:$port: $@\n"; > > $Cmdstrng = "GO\n"; > print $sock $Cmdstrng; > > > MainLoop; > > > #Asi mando commandos al servidor: > > $Cmdstrng = "SET 1 GA 1 1 1 -1\n"; > print $sock $Cmdstrng; > > > # Hay commandos a los cuales el servidor responde con informacion: > > $Cmdstrng = "GET 3 FB 32\n"; > print $sock $Cmdstrng; > > $server_response = ???????????; > > > #Ahora la pregunta: Como tengo accesso a esta repuesta del servidor? > #Con telnet funciona bien. > > > Hans > > From holzem at cantv.net Sat Oct 4 09:41:29 2008 From: holzem at cantv.net (Hans Olzem) Date: Sat, 4 Oct 2008 12:11:29 -0430 Subject: [caracas-pm] IO:Socket In-Reply-To: <1223037690.5481.8.camel@localhost> References: <20081003073059.1025938a.holzem@cantv.net> <1223037690.5481.8.camel@localhost> Message-ID: <20081004121129.03c6ab39.holzem@cantv.net> Hola Luis, gracias por la ayuda. Usando getlines() me arroja un error: TK::Error: Can't call $io->getlines in a scalar context. Constructos con $sock->getline o <$sock> siempre terminan congelandose la aplicacion . Saludos Hans On Fri, 03 Oct 2008 08:11:30 -0430 "Luis E." Mu?oz wrote: > On Fri, 2008-10-03 at 07:30 -0430, Hans Olzem wrote: > > #Ahora la pregunta: Como tengo accesso a esta repuesta del servidor? > > #Con telnet funciona bien. > > IO::Socket es una especializaci?n de IO::Handle, de manera que todos los > m?todos de ::Handle est?n disponibles. Esto es, el socket es un > filehandle. > > Puedes leer usando varias f?rmulas. Usa la que te parezca m?s c?moda > (este ejemplo es un cliente HTTP m?nimo): > > ### Usando ->getlines > > #! /usr/bin/perl > > use strict; > use warnings; > use IO::Socket; > > my $sock = new IO::Socket::INET (PeerAddr => 'localhost:80', Proto => > 'tcp') > or die "Failed to create socket: $!\n"; > > print $sock "GET / HTTP/1.0\r\n\r\n" > or die "Failed to send: $!\n"; > > print $_ for $sock->getlines; > # O esta variante > # print $_ for <$sock>; > > __END__ > > Saludos > > -lem > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm -- Hans Olzem From lem at itverx.com.ve Mon Oct 6 05:38:34 2008 From: lem at itverx.com.ve (Luis E. =?ISO-8859-1?Q?Mu=F1oz?=) Date: Mon, 06 Oct 2008 08:08:34 -0430 Subject: [caracas-pm] IO:Socket In-Reply-To: <20081004121129.03c6ab39.holzem@cantv.net> References: <20081003073059.1025938a.holzem@cantv.net> <1223037690.5481.8.camel@localhost> <20081004121129.03c6ab39.holzem@cantv.net> Message-ID: <1223296714.5279.3.camel@localhost> On Sat, 2008-10-04 at 12:11 -0430, Hans Olzem wrote: > Usando getlines() me arroja un error: > > TK::Error: Can't call $io->getlines in a scalar context. F?jate lo que dice la documentaci?n de getlines() $io->getlines This works like <$io> when called in a list context to read all the remaining lines in a file, except that it?s more readable. It will also croak() if accidentally called in a scalar context. > Constructos con $sock->getline o <$sock> siempre terminan > congelandose la aplicacion . Por lo que he visto, asumo que est?s haciendo el cliente para alg?n servidor en un protocolo orientado a l?neas. T?picamente las aplicaciones cliente se "congelan" cuando tratan de leer al mismo tiempo que el servidor (ie, ambos est?n esperando por el otro). Trata de generar una traza de lo enviado y recibido para orientarte. Saludos -lem From holzem at cantv.net Mon Oct 6 13:34:31 2008 From: holzem at cantv.net (Hans Olzem) Date: Mon, 6 Oct 2008 16:04:31 -0430 Subject: [caracas-pm] IO:Socket In-Reply-To: <1223296714.5279.3.camel@localhost> References: <20081003073059.1025938a.holzem@cantv.net> <1223037690.5481.8.camel@localhost> <20081004121129.03c6ab39.holzem@cantv.net> <1223296714.5279.3.camel@localhost> Message-ID: <20081006160431.e25e1dc8.holzem@cantv.net> Hola Luis, el problema era que trate leer a un buffer vacillo. Por esto se congelo esperando a una respuesta. Gracias por la ayuda. Hans On Mon, 06 Oct 2008 08:08:34 -0430 "Luis E." Mu?oz wrote: > On Sat, 2008-10-04 at 12:11 -0430, Hans Olzem wrote: > > Usando getlines() me arroja un error: > > > > TK::Error: Can't call $io->getlines in a scalar context. > > F?jate lo que dice la documentaci?n de getlines() > > $io->getlines > This works like <$io> when called in a list context to read > all the > remaining lines in a file, except that it?s more readable. > It will > also croak() if accidentally called in a scalar context. > > > Constructos con $sock->getline o <$sock> siempre terminan > > congelandose la aplicacion . > > Por lo que he visto, asumo que est?s haciendo el cliente para alg?n > servidor en un protocolo orientado a l?neas. T?picamente las > aplicaciones cliente se "congelan" cuando tratan de leer al mismo tiempo > que el servidor (ie, ambos est?n esperando por el otro). > > Trata de generar una traza de lo enviado y recibido para orientarte. > > Saludos > > -lem > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm -- Hans Olzem From emhnemhn at gmail.com Mon Oct 13 06:54:03 2008 From: emhnemhn at gmail.com (Ernesto Hernandez-Novich) Date: Mon, 13 Oct 2008 09:24:03 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= Message-ID: <1223906043.4603.3.camel@trillian.ius.cc> Este s?bado corresponde con la reuni?n de Octubre... "el regreso a clases" :-) ?Ideas? ?Participantes? -- Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! Geek by nature, Linux by choice, Debian of course. If you can't aptitude it, it isn't useful or doesn't exist. GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 From carloscuclug at gmail.com Mon Oct 13 07:01:08 2008 From: carloscuclug at gmail.com (Carlos Palacios) Date: Tue, 14 Oct 2008 09:31:08 +1930 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <1223906043.4603.3.camel@trillian.ius.cc> References: <1223906043.4603.3.camel@trillian.ius.cc> Message-ID: <9755ecda0810130701m19b281adu7c90b371151697ef@mail.gmail.com> presente este Sabado 2008/10/14 Ernesto Hernandez-Novich > Este s?bado corresponde con la reuni?n de Octubre... "el regreso a > clases" :-) > > ?Ideas? ?Participantes? > -- > Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! > Geek by nature, Linux by choice, Debian of course. > If you can't aptitude it, it isn't useful or doesn't exist. > GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm -- _________________________________ **** ** * ** * * ** * Carlos Palacios Linux User# 395648 freshmeat # 435313 GPG Key Fingerprint = Key fingerprint = ED3C 6EA3 4985 6BCD 1A40 FD19 A5B2 16E2 6778 4D4E Esp. en Telecomunicaciones Analista de Sistemas III Movil: 0416 y 0412 3013268 / 0414 1959148 Ofc: 4097919 pagina: http://www.esin.com.ve blog: http://esincp.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From edward.josette at gmail.com Mon Oct 13 02:47:34 2008 From: edward.josette at gmail.com (Edward Ortega) Date: Mon, 13 Oct 2008 05:17:34 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <9755ecda0810130701m19b281adu7c90b371151697ef@mail.gmail.com> References: <1223906043.4603.3.camel@trillian.ius.cc> <9755ecda0810130701m19b281adu7c90b371151697ef@mail.gmail.com> Message-ID: <48F31936.8000207@gmail.com> Presente. Carlos Palacios escribi?: > presente este Sabado > > > 2008/10/14 Ernesto Hernandez-Novich > > > Este s?bado corresponde con la reuni?n de Octubre... "el regreso a > clases" :-) > > ?Ideas? ?Participantes? > -- > Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! > Geek by nature, Linux by choice, Debian of course. > If you can't aptitude it, it isn't useful or doesn't exist. > GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C > 85E3 > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm > > > > > -- > _________________________________ **** ** * ** * * ** * Carlos Palacios > Linux User# 395648 freshmeat # 435313 GPG Key Fingerprint = Key > fingerprint = ED3C 6EA3 4985 6BCD 1A40 FD19 A5B2 16E2 6778 4D4E Esp. en > Telecomunicaciones Analista de Sistemas III Movil: 0416 y 0412 > 3013268 / 0414 1959148 Ofc: 4097919 pagina: http://www.esin.com.ve > blog: http://esincp.blogspot.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: From holzem at cantv.net Mon Oct 13 11:11:43 2008 From: holzem at cantv.net (Hans Olzem) Date: Mon, 13 Oct 2008 13:41:43 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <1223906043.4603.3.camel@trillian.ius.cc> References: <1223906043.4603.3.camel@trillian.ius.cc> Message-ID: <20081013134143.5e77e2b0.holzem@cantv.net> Hola Ernesto, voy. Que tal el tema: control de trenes con Linux y Perl/Tk? Saludos Hans On Mon, 13 Oct 2008 09:24:03 -0430 Ernesto Hernandez-Novich wrote: > Este s?bado corresponde con la reuni?n de Octubre... "el regreso a > clases" :-) > > ?Ideas? ?Participantes? > -- > Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! > Geek by nature, Linux by choice, Debian of course. > If you can't aptitude it, it isn't useful or doesn't exist. > GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm -- Hans Olzem From tovar.nelo at gmail.com Mon Oct 13 12:38:53 2008 From: tovar.nelo at gmail.com (Nelo R. Tovar) Date: Mon, 13 Oct 2008 15:08:53 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <20081013134143.5e77e2b0.holzem@cantv.net> References: <1223906043.4603.3.camel@trillian.ius.cc> <20081013134143.5e77e2b0.holzem@cantv.net> Message-ID: <48F3A3CD.8080507@gmail.com> All? estar?. Hans Olzem wrote: > Hola Ernesto, > > voy. > > Que tal el tema: control de trenes con Linux y Perl/Tk? > > Saludos > > Hans > > > > On Mon, 13 Oct 2008 09:24:03 -0430 > Ernesto Hernandez-Novich wrote: > > >> Este s?bado corresponde con la reuni?n de Octubre... "el regreso a >> clases" :-) >> >> ?Ideas? ?Participantes? >> -- >> Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! >> Geek by nature, Linux by choice, Debian of course. >> If you can't aptitude it, it isn't useful or doesn't exist. >> GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 >> >> _______________________________________________ >> caracas-pm mailing list >> caracas-pm at pm.org >> http://mail.pm.org/mailman/listinfo/caracas-pm >> > > From agazso at ius.cc Mon Oct 13 13:04:42 2008 From: agazso at ius.cc (Andres Gazso) Date: Mon, 13 Oct 2008 15:34:42 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <20081013134143.5e77e2b0.holzem@cantv.net> References: <1223906043.4603.3.camel@trillian.ius.cc> <20081013134143.5e77e2b0.holzem@cantv.net> Message-ID: <1223928282.23019.154.camel@vader.ius.cc> Excelente! Llevas al menos un tren? Vader. On Mon, 2008-10-13 at 13:41 -0430, Hans Olzem wrote: > Hola Ernesto, > > voy. > > Que tal el tema: control de trenes con Linux y Perl/Tk? > > Saludos > > Hans > > > > On Mon, 13 Oct 2008 09:24:03 -0430 > Ernesto Hernandez-Novich wrote: > > > Este s?bado corresponde con la reuni?n de Octubre... "el regreso a > > clases" :-) > > > > ?Ideas? ?Participantes? > > -- > > Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! > > Geek by nature, Linux by choice, Debian of course. > > If you can't aptitude it, it isn't useful or doesn't exist. > > GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 > > > > _______________________________________________ > > caracas-pm mailing list > > caracas-pm at pm.org > > http://mail.pm.org/mailman/listinfo/caracas-pm > From holzem at cantv.net Thu Oct 16 16:12:04 2008 From: holzem at cantv.net (Hans Olzem) Date: Thu, 16 Oct 2008 18:42:04 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <1223906043.4603.3.camel@trillian.ius.cc> References: <1223906043.4603.3.camel@trillian.ius.cc> Message-ID: <20081016184204.c8e9d65a.holzem@cantv.net> Solo para confirmar: nos vamos a ver este Sabado a las 9 am en el ISEIT en La Trinidad? Estan de acuerdo con el tema? Saludos Hans On Mon, 13 Oct 2008 09:24:03 -0430 Ernesto Hernandez-Novich wrote: > Este s?bado corresponde con la reuni?n de Octubre... "el regreso a > clases" : > > ?Ideas? ?Participantes? > -- > Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! > Geek by nature, Linux by choice, Debian of course. > If you can't aptitude it, it isn't useful or doesn't exist. > GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 > > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm -- Hans Olzem From jesus at unixsup.com Thu Oct 16 18:32:21 2008 From: jesus at unixsup.com (JesUs Lima) Date: Thu, 16 Oct 2008 21:32:21 -0400 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubr_e?= In-Reply-To: <20081016184204.c8e9d65a.holzem@cantv.net> References: <1223906043.4603.3.camel@trillian.ius.cc> <20081016184204.c8e9d65a.holzem@cantv.net> Message-ID: <20081017012444.M76442@unixsup.com> Hola *, Yo soy nuevo en la lista, me interesa el tema pues tengo trenes escala HO y N, an?logos y algunos digitales, aunque los opero de forma an?loga me entusiama la propuesta. Lamentablemente no me serA posible asistir este sAbado; espero les aproveche. Saludos, JesUs. www.unixsup.com ---------- Original Message ----------- From: Hans Olzem To: caracas-pm at pm.org Sent: Thu, 16 Oct 2008 18:42:04 -0430 Subject: Re: [caracas-pm] Reuni?n de Octubre > Solo para confirmar: > > nos vamos a ver este Sabado a las 9 am en el ISEIT en La Trinidad? > Estan de acuerdo con el tema? > > Saludos > > Hans > > On Mon, 13 Oct 2008 09:24:03 -0430 > Ernesto Hernandez-Novich wrote: > > > Este s?bado corresponde con la reuni?n de Octubre... "el regreso a > > clases" : > > > > ?Ideas? ?Participantes? > > -- > > Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! > > Geek by nature, Linux by choice, Debian of course. > > If you can't aptitude it, it isn't useful or doesn't exist. > > GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3 > > > > _______________________________________________ > > caracas-pm mailing list > > caracas-pm at pm.org > > http://mail.pm.org/mailman/listinfo/caracas-pm > > -- > Hans Olzem > _______________________________________________ > caracas-pm mailing list > caracas-pm at pm.org > http://mail.pm.org/mailman/listinfo/caracas-pm ------- End of Original Message ------- From emhnemhn at gmail.com Fri Oct 17 05:00:44 2008 From: emhnemhn at gmail.com (Ernesto Hernandez-Novich) Date: Fri, 17 Oct 2008 07:30:44 -0430 Subject: [caracas-pm] =?iso-8859-1?q?Reuni=F3n_de_Octubre?= In-Reply-To: <20081016184204.c8e9d65a.holzem@cantv.net> References: <1223906043.4603.3.camel@trillian.ius.cc> <20081016184204.c8e9d65a.holzem@cantv.net> Message-ID: <1224244844.4898.0.camel@trillian.ius.cc> On Thu, 2008-10-16 at 18:42 -0430, Hans Olzem wrote: > Solo para confirmar: > > nos vamos a ver este Sabado a las 9 am en el ISEIT en La Trinidad? > Estan de acuerdo con el tema? Si, nos vemos. -- Ernesto Hern?ndez-Novich - Linux 2.6.18 i686 - Unix: Live free or die! Geek by nature, Linux by choice, Debian of course. If you can't aptitude it, it isn't useful or doesn't exist. GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3