Improvements for BOA
- Allowed write buffers to become very large in asynnet. Thus in order to allow for the transfer of large images. tested ub to 2kx2k, 16MB - Handle lack of space in the write buffer more gracefully: just skip the image
This commit is contained in:
18
asynnet.c
18
asynnet.c
@ -45,7 +45,8 @@
|
||||
#define MAXCONNECTIONS 1024
|
||||
#define RBUFFERSIZE 262144 /* 256kb */
|
||||
#define WBUFFERSIZE 20*262144
|
||||
/* #define WBUFFERSIZE 100*262144 /*
|
||||
/* #define WBUFFERSIZE 100*262144 */
|
||||
#define MAXWBUFFERSIZE 128*1000*1024
|
||||
/*--------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
int socket;
|
||||
@ -204,7 +205,7 @@ int ANETregisterSocket(int socket)
|
||||
flags =1;
|
||||
setsockopt(socket,IPPROTO_TCP,TCP_NODELAY,(char *) &flags, sizeof(int));
|
||||
socke.readBuffer = MakeRWPuffer(RBUFFERSIZE);
|
||||
socke.writeBuffer = MakeRWPuffer(WBUFFERSIZE);
|
||||
socke.writeBuffer = MakeBigRWPuffer(WBUFFERSIZE, MAXWBUFFERSIZE);
|
||||
if (socke.readBuffer == NULL || socke.writeBuffer == NULL) {
|
||||
return ANETMEM;
|
||||
}
|
||||
@ -498,7 +499,20 @@ int ANETinfo(int handle, char *hostname, int hostnameLen)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int ANETcanWrite(int handle, void *buffer, int count)
|
||||
{
|
||||
pSocketDescriptor con = NULL;
|
||||
int status;
|
||||
|
||||
con = findSocketDescriptor(handle);
|
||||
if (con == NULL) {
|
||||
return ANETDISCONNECTED;
|
||||
} else {
|
||||
ANETprocess();
|
||||
return CanStoreRWBuffer(con->writeBuffer, buffer, count);
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int ANETwrite(int handle, void *buffer, int count)
|
||||
{
|
||||
|
Reference in New Issue
Block a user