Re: help with sockets

2006-11-08 Thread Alejandro Santillan
> Untested code : > > use strict; > use warnings; > use IO::Select; > > # Your socket opening code here > > my $read_set = new IO::Select(); > $read_set->add($handle); > > my $file = ''; # accumulated stream data > > while (1) { > > my @ready = $read_set->can_read(0.1); > > # do any other stuff tha

Re: help with sockets

2006-11-07 Thread $Bill Luebkert
Alejandro Santillan wrote: > The $i reaches the number 57, before hanging. It seems that well before > reaching > the !END! string it reads some char undef or something. You need to check $bytes for error and EOF before reading again. >>>whereas: >>> >>> >my $buffer; >my $bytes = sysread

Re: help with sockets

2006-11-07 Thread Alejandro Santillan
> > It seems that increasing the buffer more thant 1024 didn't help in all > > cases. It seems that this stream of data comes in several packets and the > > terminator string is !END! > > I've tried reading one byte at a time, using an $i as offset, and checking > > whenever the END pattern showed

Re: help with sockets

2006-11-07 Thread $Bill Luebkert
Alejandro Santillan wrote: >>Alejandro Santillan wrote: >> >> >>>Bill, I was using your solution successfully to read several messages > > sent > >>>by the server, but when trying to work some request, >>>which had a longer answer, your buffer only gets: >> >>... >> >>>How could I modify your ro

Re: help with sockets

2006-11-07 Thread Alejandro Santillan
> Alejandro Santillan wrote: > > > Bill, I was using your solution successfully to read several messages sent > > by the server, but when trying to work some request, > > which had a longer answer, your buffer only gets: > ... > > How could I modify your routine, which is the following: > > > > my

Re: help with sockets

2006-11-01 Thread $Bill Luebkert
Alejandro Santillan wrote: > Bill, I was using your solution successfully to read several messages sent > by the server, but when trying to work some request, > which had a longer answer, your buffer only gets: ... > How could I modify your routine, which is the following: > > my $buffer; > my $b

Re: help with sockets

2006-11-01 Thread Alejandro Santillan
>> The output was >> 8=FIX.4.0.C35=A52=10/26/2006 8:16:10 AM100=PFG10=999 >> What is simply correct, but if I put 58 instead of 57, the program hangs >> indefinitely. >> Obviously I don't know the lengh fo the message beforehand. >> >> Anyone has any idea why this happens and how to avoid it? > >

Re: help with sockets

2006-11-01 Thread Alejandro Santillan
>> The output was >> 8=FIX.4.0.C35=A52=10/26/2006 8:16:10 AM100=PFG10=999 >> What is simply correct, but if I put 58 instead of 57, the program hangs >> indefinitely. >> Obviously I don't know the lengh fo the message beforehand. >> >> Anyone has any idea why this happens and how to avoid it? > >Tr

Re: help with sockets

2006-10-27 Thread Chris Wagner
At 12:53 PM 10/26/2006 -0300, Alejandro Santillan wrote: >Thanks Rob. I think that my problem is just the terminator character, but on >the string sent by the server, and not mine. U should be able to manually telnet to the port and do the transaction by just typing/pasting the string. Does that

Re: help with sockets

2006-10-26 Thread $Bill Luebkert
Alejandro Santillan wrote: > The output was: > 8=FIX.4.0.C35=A52=10/26/2006 8:16:10 AM100=PFG10=999 > What is simply correct, but if I put 58 instead of 57, the program hangs > indefinitely. > Obviously I don't know the lengh fo the message beforehand. > > Anyone has any idea why this happens and

Re: help with sockets

2006-10-26 Thread Alejandro Santillan
- From: "Sisyphus" <[EMAIL PROTECTED]> To: "Alejandro Santillan" <[EMAIL PROTECTED]>; Cc: "perl-win32-user" Sent: Thursday, October 26, 2006 1:24 AM Subject: Re: help with sockets - Original Message - From: "Alejandro Santillan" <[EM

Re: help with sockets

2006-10-26 Thread Alejandro Santillan
- From: "Sisyphus" <[EMAIL PROTECTED]> To: "Alejandro Santillan" <[EMAIL PROTECTED]>; Cc: "perl-win32-user" Sent: Thursday, October 26, 2006 1:24 AM Subject: Re: help with sockets - Original Message - From: "Alejandro Santillan" <[EM

Re: help with sockets

2006-10-25 Thread Sisyphus
- Original Message - From: "Alejandro Santillan" <[EMAIL PROTECTED]> . . > > use IO::Socket; > > $message1="8=FIX.4.0.c☺35=A☺9998=D3765☺9997=4443734☺9996=Bara☺"; #Try instead: $message1="8=FIX.4.0.c☺35=A☺9998=D3765☺9997=4443734☺9996=Bara☺\n"; I don't know if that will fix the problem, b

help with sockets

2006-10-25 Thread Alejandro Santillan
I need to connect to a TCP server that uses a protocol called fix (financial information exchange) Basically the server receives a text string and answers with a text string also. The protocol is pretty simple, and it consists in a series of fields separated by the char alt+1:☺ $message1="8=FIX.4.

help with sockets

2006-10-25 Thread Alejandro Santillan
I need to connect to a TCP server that uses a protocol called fix (financial information exchange) Basically the server receives a text string and answers with a text string also. The protocol is pretty simple, and it consists in a series of fields separated by the char alt+1:☺ $message1="8=FIX.4.