euTcp4u bug
- Posted by Alexander Toresson <toressonodakra at swipnet.se> Dec 05, 2004
- 446 views
The function tcp4u_receive() should be changed into:
global function tcp4u_receive(atom socket, integer buff_size, integer time_out) integer ret atom buff_addr sequence buff_seq buff_addr = allocate(buff_size) ret = c_func(myTcpRecv, {socket, buff_addr, buff_size, time_out, TCP4U_FILE_ERROR}) if ret > 0 then buff_seq = peek_sequence(buff_addr, ret) ret = TCP4U_SUCCESS -- this line should be added else buff_seq = {} end if free(buff_addr) return {ret, buff_seq} end function
Otherwise, this function, when successful, returns the number of bytes received instead of the return code in ret. Regards, Alexander Toresson Shhh! Be vewy quiet! I'm hunting wuntime ewwows!