WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Winsock
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

WinSock Buffer Problem


Question:

I have extensive code that was last compiled and run in WB2001 that I’m upgrading and recompiling in WB2004F. The apps are a software distribution system where a server sends package info to hundreds or thousands of client PCs. Much of the code runs as services on the client and the server. All communication are over sockets.

The problem appears to be that the sRecvline() or sSendline has truncated the string to 1024 bytes, in spite of the fact that the call specifies 7499 byte in length. I have large chunks of code that were tested in WB2001 that use this extender in a similar way that pass longer strings than 1024 bytes.

Answer:

After some serious debugging of the Winsock functions it seems the sSendLine function seems to be the cause.

If I change it to sSendString....the sRecvLine function on the receive side is quite happy and gets all the data...

Or If I change the line to

sSendLine(socket, strcat(req,@crlf))
then it also works.

Basically the sSendLine function looks to see if you already appended a CRLF to your data. If you did, it sends the line as-is and it works. If you did not, then it appends a CRLF to the data and sends that. This is the part that seems to be failing.

Sooooo in any case it looks good for a near term fix.

A fix will be available in next Winsock dll release 11168...


Article ID:   W16382
File Created: 2005:02:18:12:20:08
Last Updated: 2005:02:18:12:20:08