I've noticed an issue with some of my scripts that use sockets since using 7.xx where the data doesn't get sent instantly as it is now queued but any other socket events such as sockclose seem to be put ahead of this queue and do not produce an error that the socket didn't receive the sent data.

See example below:

Code:
on *:SOCKLISTEN:TestSocket:{
 sockaccept test.s
 echo -s socket accepted
 sockwrite -tn test.s this is a test
}
on *:SOCKREAD:test*:{
 if ($sockerr > 0) { echo -s error on socket | sockclose $sockname }
 sockread -fn &Read.test | tokenize 32 $bvar(&Read.test,1,$bvar(&Read.test,0)).text
 echo -s $sockname received: $1-
 if ($1 == dotest) {
  sockwrite -tn $sockname testing 1
  sockwrite -tn $sockname testing 2
  sockwrite -tn $sockname testing 3
  sockclose $sockname
 }
}
on *:SOCKWRITE:test*:{
 echo -s $sockname sent data
}
on *:SOCKCLOSE:test*:{
 echo -s $sockname socket closed
}
on *:SOCKOPEN:test*:{
 echo -s $sockname socket opened
 if ($sockname == test) { sockwrite -tn test dotest }
}
alias testsocket {
 socklisten TestSocket 1010
 sockopen test localhost 1010
}
alias sockwrite {
 echo -s data sent to: $2 was: $3-
 sockwrite $1-
}


Result from 7.xx:

Code:
socket accepted
data sent to: test.s was: this is a test
test socket opened
data sent to: test was: dotest
test.s sent data
test sent data
test received: this is a test
test.s received: dotest
data sent to: test.s was: testing 1
data sent to: test.s was: testing 2
data sent to: test.s was: testing 3
test socket closed


Result from earlier versions (6.35):

Code:
test socket opened
data sent to: test was: dotest
socket accepted
data sent to: test.s was: this is a test
test sent data
test.s sent data
test received: this is a test
test.s received: dotest
data sent to: test.s was: testing 1
data sent to: test.s was: testing 2
data sent to: test.s was: testing 3
test received: testing 1
test received: testing 2
test received: testing 3
test socket closed


Is this intentional? If not it means I will need to re-write my scripts that use sockets

Last edited by Rewtor; 16/02/11 03:21 PM.