TCP_SocketNoDelay.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.1.1.1 $
00022 // $Date: 2000/09/15 08:23:16 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/actor/channel/TCP_SocketNoDelay.h,v $
00024                                                                         
00025                                                                         
00026 // File: ~/actor/TCP_SocketNoDelay.h
00027 //
00028 // Written: fmk 11/95
00029 // Revised:
00030 //
00031 // Purpose: This file contains the class definition for TCP_SocketNoDelay.
00032 // TCP_SocketNoDelay is a sub-class of channel. It is implemented with Berkeley
00033 // stream sockets using the TCP protocol. Messages delivery is garaunteed. 
00034 // Communication is full-duplex between a pair of connected sockets.
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 

Generated on Mon Oct 23 15:04:56 2006 for OpenSees by doxygen 1.5.0