mIRC Home    About    Download    Register    News    Help

Print Thread
SOCK Write Queing #88608 29/06/04 10:34 PM
Joined: Jun 2004
Posts: 5
Z
Zeraphm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Jun 2004
Posts: 5
Hello

I was recently using mIRC to be a link between some software and a datapipe. Basically, I was feeding the software with data from the datapipe using the code below.

Code:
on 1:sockread:dren*:{
  if ($sockerr > 0) { return }
  :nextread
  sockread &drenread
  if ($sockbr == 0) { return }
  sockwrite $sock($sockname).mark &drenread
}


I came up with the error of the queue being full at 16384 bytes. I came up with some solutions but none of them really worked out. So I was wondering if someone could help me with a way to feed the software with the data without any errors. The datapipe is sending at roughly 500K if it helps any.

Re: SOCK Write Queing #88609 30/06/04 09:14 AM
Joined: Mar 2004
Posts: 130
T
tsoglanos Offline
Vogon poet
Offline
Vogon poet
T
Joined: Mar 2004
Posts: 130
you should check how much info is currently queued by using $sock().sq (send queue) before trying to queue info on a socket.

somthing like this
Code:
  
if ($sock($sockname).sq < 16000) { sockwrite bla bla }

or maby 

if ($sock($sockname).sq > 16000) { return }


becuse the maximum info can be queued is 16384
also you sould wait while there is still info queued in the send buffer before using the sockwrite command again

Last edited by tsoglanos; 30/06/04 09:28 AM.
Re: SOCK Write Queing #88610 30/06/04 03:22 PM
Joined: Jun 2004
Posts: 5
Z
Zeraphm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Jun 2004
Posts: 5
I was thinking about that, but it was my understanding that once I do the sockread and do nothing with it, all the info will be gone. So like if I insert your code at the end, I will do a sockread &drenread and then it will see that the send queue is full and it will return, but than once the on:*:sockread is triggered again, I will do another sockread &drenread and lose all information inside of the previous &drenread

Re: SOCK Write Queing #88611 30/06/04 03:31 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922