/* $Id: string-transfer.h,v 1.5 1999/08/06 15:27:44 v2kea318 Exp $

$Log: string-transfer.h,v $
 * Revision 1.5  1999/08/06  15:27:44  v2kea318
 * Added write_int and read_int.
 *
 * Revision 1.4  1999/07/30  17:55:48  v2kea318
 * Reformat the header file names for Standard C++ compliance.
 *
 * Revision 1.3  1999/07/09  14:50:10  v2kea318
 * Got rid of the optional flag on read_string.  The function will now require
 * that the correct number of bytes be read and will block until satisfied.
 *
 * Revision 1.2  1999/07/06  19:52:11  v2kea318
 * Added the boolean flag retry to the read_string() prototype.  A default
 * value of false is set, to maintain the old operation unless explicitly
 * changed by the caller.
 *
 * Revision 1.1  1999/05/07  16:16:38  v2kea318
 * Initial revision
 *
***************************************************************************

Define routines to transfer a string or an int over a socket connection.  
The string will be sent in two steps:  the number of bytes will be written
to the socket then the string itself.  Int's will be transferred using
network byte ordering.

***************************************************************************/

#ifndef STRING_TRANSFER_H
#define STRING_TRANSFER_H

#include <string>
#include "Socket.h"

// send the string
void write_string(const Socket& sock, const string& s);

/* Receive the string.  The routine will block until all the required
   bytes are read. */
void read_string(const Socket& sock, string& s);

// send the int.
void write_int(const Socket& sock, const size_t i);

// read an int
void read_int(const Socket& sock, size_t& i);

#endif
