Page 2 of 2

Posted: Fri Aug 18, 2006 5:48 am
by Anden
Yeah, very nice effort, great code.

Would be desirable as a userlib and a replacement for Send/ReceiveNetworkFile. E.g. SendNetworkFilePlus and ReceiveNetworkFilePlus. On every call it returns the progress status (thus spare a callback).

At last (and i don't wanna spoil the fun):

What happens if another/foreign packet (after checking for #SendFile once) triggers the #PB_NetworkEvent_Data event while receiving the file in the loop?

What happens if (more than) one packet overhauls another one? Will the resulting file be still valid/useable?

Posted: Fri Aug 18, 2006 7:22 am
by Bonne_den_kule
@Anden: It is not possible to make this a library to use it as a replacement for the standard Send/ReceiveNetworkFile.

@NoahPhense: I have no place to upload it

Posted: Sat Aug 19, 2006 10:55 pm
by Bonne_den_kule
It may be possible to make this a dll. I am not sure if the network stuff will interfere with the calling process' networking commands.

If it's possible, I will do that.

Posted: Sun Aug 20, 2006 11:01 pm
by Tranquil
@ Bonne_den_kule:

Please keep in mind that ReceiveNetworkData() and SendNetworkData() could return -1 (#SOCKET_ERROR) if something goes wrong.

In this case your "BytesSended" calculation is wrong. I also fall into this hole some years ago.

You should allways check for <>-1 and catch WSAGetLastError_() if -1 is returned by one of these commands. (WSA_Would_Bock is an error which often happens in low bandwith or busy networks)

Mike