Increase buffer size for the client-server messages and consistently use MAXBUF.
This commit is contained in:
parent
c1ee6aa9ff
commit
e4c19fefee
2 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ using std::cout;
|
|||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
#define MAXBUF 1024
|
||||
#define MAXBUF 16384
|
||||
#define BUSY_WAIT_TIME 30
|
||||
|
||||
using std::string;
|
||||
|
@ -145,7 +145,7 @@ long int get_next_task( const string& host, int port, long int last_tile ) {
|
|||
long int tile;
|
||||
int sock, len;
|
||||
fd_set ready;
|
||||
char message[256];
|
||||
char message[MAXBUF];
|
||||
|
||||
// loop till we get a socket connection
|
||||
while ( (sock = make_socket( (char *)host.c_str(), port )) < 0 ) {
|
||||
|
@ -175,7 +175,7 @@ long int get_next_task( const string& host, int port, long int last_tile ) {
|
|||
|
||||
if ( FD_ISSET(sock, &ready) ) {
|
||||
/* input coming from socket */
|
||||
if ( (len = read(sock, message, 1024)) > 0 ) {
|
||||
if ( (len = read(sock, message, MAXBUF)) > 0 ) {
|
||||
message[len] = '\0';
|
||||
tile = atoi(message);
|
||||
cout << " tile to construct = " << tile << endl;
|
||||
|
|
|
@ -41,7 +41,7 @@ using std:: string ;
|
|||
# define WAIT_ANY (pid_t)-1
|
||||
#endif
|
||||
|
||||
#define MAXBUF 1024
|
||||
#define MAXBUF 16384
|
||||
|
||||
static double start_lon, start_lat;
|
||||
static double lat = 0.0;
|
||||
|
|
Loading…
Reference in a new issue