Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2005, 8:13:22 AM (19 years ago)
Author:
rennerc
Message:

network_socket: removed listen function
server_socket: created serversocket
network_unit_test: replaced sockettest for new client/socket model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_socket.h

    r5829 r5987  
    1818//sleep if outgoing buffer is empty
    1919#define _MSECONDS_SLEEP_EMPTY_BUFFER 10
    20 //sleep when waiting for connections
    21 #define _MSECONDS_SLEEP_LISTEN 100
     20
    2221
    2322/* contains memmove and memcpy */
     
    6463  bool terminateThread;
    6564
    66   static int thread_listen(void * data);
    6765  static int thread_read(void * data);
    6866#ifdef _USE_OUTGOING_BUFFER
     
    7068#endif
    7169
    72   bool _isListening;
     70  int writeBytes(byte * data, int length);
     71  int readBytes(byte * data, int length);
     72  int readBlock(byte * data, int length);
     73
     74  void init();
    7375
    7476public:
     
    7678  NetworkSocket();
    7779  NetworkSocket(IPaddress ip);
     80  NetworkSocket(TCPsocket sock);
    7881  ~NetworkSocket();
    7982
    8083  void connectToServer(IPaddress ip);
    81   void listen(unsigned int port);
    8284  void disconnectServer();
    83   int writeBytes(byte * data, int length);
    84   int readBytes(byte * data, int length);
    85   int readBlock(byte * data, int length);
    8685
    87 private:
    88   void init();
     86  bool writePacket(byte * data, int length);
     87  int readPacket(byte * data, int maxLength);
    8988
    9089};
Note: See TracChangeset for help on using the changeset viewer.