Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2005, 10:14:48 PM (18 years ago)
Author:
patrick
Message:

The NetworkSocket now uses a real network protocol: packet size is read out dynamicaly: therefore the NetworkStream now has an internal state that
checks if its reading header or body data

File:
1 edited

Legend:

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

    r5804 r5809  
    88
    99#include "data_stream.h"
     10#include "network_protocol.h"
    1011
    1112class Synchronizeable;
     
    1314class ConnectionMonitor;
    1415class NetworkProtocol;
     16
     17
     18//<! The state of the NetworkStream
     19typedef enum NetStat {
     20  NET_REC_HEADER = 0,                          //!< Waiting for header
     21  NET_REC_DATA,                                //!< Waiting for data
     22
     23  NUM_STATES                                   //!< Number of states
     24};
     25
    1526
    1627class NetworkStream : public DataStream
     
    2132  NetworkStream(IPaddress& address, Synchronizeable& sync, NodeType type);
    2233  NetworkStream(Synchronizeable& sync, unsigned int port, NodeType type);
    23 
    2434  ~NetworkStream();
    2535
     
    3747   NetworkSocket* networkSocket;
    3848   int                    type;
     49   int                    state;
     50   Header                 packetHeader;
    3951};
    4052#endif /* _NETWORK_STREAM */
Note: See TracChangeset for help on using the changeset viewer.