Edited maximum "send through socket" size for windows
This commit is contained in:
parent
7e5d7264ae
commit
1e7766701d
1 changed files with 8 additions and 2 deletions
|
@ -17,6 +17,12 @@
|
||||||
|
|
||||||
#define BUFFER_BLOCKSIZE 4096 //set buffer blocksize to 4KiB
|
#define BUFFER_BLOCKSIZE 4096 //set buffer blocksize to 4KiB
|
||||||
|
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
#define SOCKETSIZE 8092ul
|
||||||
|
#else
|
||||||
|
#define SOCKETSIZE 51200ul
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string uint2string(unsigned int i) {
|
std::string uint2string(unsigned int i) {
|
||||||
std::stringstream st;
|
std::stringstream st;
|
||||||
st << i;
|
st << i;
|
||||||
|
@ -456,9 +462,9 @@ void Socket::Connection::SendNow(const char * data, size_t len) {
|
||||||
if (!bing) {
|
if (!bing) {
|
||||||
setBlocking(true);
|
setBlocking(true);
|
||||||
}
|
}
|
||||||
unsigned int i = iwrite(data, std::min((long unsigned int)len, 51200ul));
|
unsigned int i = iwrite(data, std::min((long unsigned int)len, SOCKETSIZE));
|
||||||
while (i < len && connected()) {
|
while (i < len && connected()) {
|
||||||
i += iwrite(data + i, std::min((long unsigned int)(len - i), 51200ul));
|
i += iwrite(data + i, std::min((long unsigned int)(len - i), SOCKETSIZE));
|
||||||
}
|
}
|
||||||
if (!bing) {
|
if (!bing) {
|
||||||
setBlocking(false);
|
setBlocking(false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue