00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef TCP_SocketNoDelay_h
00037 #define TCP_SocketNoDelay_h
00038
00039 #include <Socket.h>
00040 #include <Channel.h>
00041 #include <SocketAddress.h>
00042
00043 class TCP_SocketNoDelay : public Channel
00044 {
00045 public:
00046 TCP_SocketNoDelay();
00047 TCP_SocketNoDelay(unsigned int);
00048 TCP_SocketNoDelay(unsigned int other_Port, char *other_InetAddr);
00049 ~TCP_SocketNoDelay();
00050
00051 virtual int setUpShadow(void);
00052 virtual int setUpActor(void);
00053
00054 int setNextAddress(const ChannelAddress &otherChannelAddress);
00055 virtual ChannelAddress *getLastSendersAddress(void){ return 0;};
00056
00057 int sendObj(MovableObject &theObject,
00058 FEM_ObjectBroker &theBroker,
00059 ChannelAddress *theAddress =0);
00060
00061 int recvObj(MovableObject &theObject,
00062 FEM_ObjectBroker &theBroker,
00063 ChannelAddress *theAddress =0);
00064
00065 int recvMsg(Message &, ChannelAddress *theAddress =0);
00066 int sendMsg(const Message &, ChannelAddress *theAddress =0);
00067
00068 int sendMatrix(const Matrix &theMatrix, ChannelAddress *theAddress =0);
00069 int recvMatrix(Matrix &theMatrix, ChannelAddress *theAddress =0);
00070
00071 int sendVector(const Vector &theVector, ChannelAddress *theAddress =0);
00072 int recvVector(Vector &theVector, ChannelAddress *theAddress =0);
00073
00074 int sendID(const ID &theID, ChannelAddress *theAddress =0);
00075 int recvID(ID &theID, ChannelAddress *theAddress =0);
00076
00077 unsigned int getPortNumber(void) const;
00078 char *addToProgram(void);
00079
00080 protected:
00081
00082 private:
00083 int sockfd;
00084 struct sockaddr_in my_Addr, other_Addr;
00085 int addrLength;
00086 unsigned int myPort;
00087 char add[40];
00088 };
00089
00090
00091 #endif
00092
00093
00094
00095
00096
00097
00098
00099