1
0
Fork 0

Increase buffer size for the client-server messages and consistently use MAXBUF.

This commit is contained in:
Maxime Guillaud 2011-10-21 08:32:52 +02:00 committed by Christian Schmitt
parent c1ee6aa9ff
commit e4c19fefee
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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;