Procházet zdrojové kódy

Fixed NO_SIGNALS should have been MSG_NOSIGNAL

git-svn-id: https://svn.microneil.com/svn/CodeDweller/trunk@16 d34b734f-a00e-4b39-a726-e4eeb87269ab
wx
madscientist před 15 roky
rodič
revize
a19714cb18
3 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. 2
    2
      networking.cpp
  2. 1
    1
      networking.hpp
  3. 2
    2
      networking.inline.hpp

+ 2
- 2
networking.cpp Zobrazit soubor

if(0 > size) // Watch out for bad sizes. if(0 > size) // Watch out for bad sizes.
throw Networking::SocketWriteError("TCPClient::transmit() 0 > size!"); throw Networking::SocketWriteError("TCPClient::transmit() 0 > size!");


int ByteCount = send(Handle, bfr, size, NO_SIGNALS); // Try to send and capture the count.
int ByteCount = send(Handle, bfr, size, MSG_NOSIGNAL); // Try to send and capture the count.
if(0 > ByteCount) ByteCount = 0; // Mask error results as 0 bytes sent. if(0 > ByteCount) ByteCount = 0; // Mask error results as 0 bytes sent.


if(size > ByteCount) { // If we didn't send it all check it out. if(size > ByteCount) { // If we didn't send it all check it out.
if(0 > size) // Watch out for bad sizes. if(0 > size) // Watch out for bad sizes.
throw Networking::SocketWriteError("TCPHost::transmit() 0 > size!"); throw Networking::SocketWriteError("TCPHost::transmit() 0 > size!");


int ByteCount = send(Handle, bfr, size, NO_SIGNALS); // Try to send and capture the count.
int ByteCount = send(Handle, bfr, size, MSG_NOSIGNAL); // Try to send and capture the count.
if(0 > ByteCount) ByteCount = 0; // Mask error results as 0 bytes sent. if(0 > ByteCount) ByteCount = 0; // Mask error results as 0 bytes sent.


if(size > ByteCount) { // If we didn't send it all check it out. if(size > ByteCount) { // If we didn't send it all check it out.

+ 1
- 1
networking.hpp Zobrazit soubor

typedef SOCKET hSocket; // Winx handles Socket is opaque. typedef SOCKET hSocket; // Winx handles Socket is opaque.
#ifndef NO_SIGNALS #ifndef NO_SIGNALS
const int NO_SIGNALS = 0; // Make NO_SIGNALS for windows.
const int MSG_NOSIGNAL = 0; // Make NO_SIGNALS for winsock.
#endif #endif


#else #else

+ 2
- 2
networking.inline.hpp Zobrazit soubor

inline void TCPClient::fillReadBuffer() { // Fills the buffer from the socket. inline void TCPClient::fillReadBuffer() { // Fills the buffer from the socket.
LastError = 0; // Clear the LastError value. LastError = 0; // Clear the LastError value.
ReadPointer = ReadBuffer; // Reset the ReadPointer. ReadPointer = ReadBuffer; // Reset the ReadPointer.
DataLength = recv(Handle, ReadBuffer, sizeof(ReadBuffer), NO_SIGNALS); // Try to read some data.
DataLength = recv(Handle, ReadBuffer, sizeof(ReadBuffer), MSG_NOSIGNAL); // Try to read some data.


if(0 >= DataLength) { // If there was an error then if(0 >= DataLength) { // If there was an error then
LastError = Network.getLastError(); // Grab the last error code. LastError = Network.getLastError(); // Grab the last error code.
inline void TCPHost::fillReadBuffer() { // Fills the buffer from the socket. inline void TCPHost::fillReadBuffer() { // Fills the buffer from the socket.
LastError = 0; // Clear the LastError value. LastError = 0; // Clear the LastError value.
ReadPointer = ReadBuffer; // Reset the ReadPointer. ReadPointer = ReadBuffer; // Reset the ReadPointer.
DataLength = recv(Handle, ReadBuffer, sizeof(ReadBuffer), NO_SIGNALS); // Try to read some data.
DataLength = recv(Handle, ReadBuffer, sizeof(ReadBuffer), MSG_NOSIGNAL); // Try to read some data.


if(0 >= DataLength) { // If there was an error then if(0 >= DataLength) { // If there was an error then
LastError = Network.getLastError(); // Grab the last error code. LastError = Network.getLastError(); // Grab the last error code.

Načítá se…
Zrušit
Uložit