コード例 #1
0
ファイル: UDP_Socket.cpp プロジェクト: fmckenna/OpenSees
int 
UDP_Socket::sendObj(int commitTag,
    MovableObject &theObject, ChannelAddress *theAddress)
{
    // set up the address of the Socket to which data will be sent
    if (theAddress != 0) {
        SocketAddress *theSocketAddress = 0;
        
        if (theAddress->getType() == SOCKET_TYPE) {
            theSocketAddress = (SocketAddress *)theAddress;
            
            bcopy((char *) &theSocketAddress->address.addr, (char *) &other_Addr.addr, 
                theSocketAddress->addrLength);
            addrLength = theSocketAddress->addrLength;
        }
        else {
            opserr << "UDP_Socket::sendObj() - a UDP_Socket ";
            opserr << "can only communicate with a UDP_Socket";
            opserr << " address given is not of type SocketAddress\n";
            return -1;
        }
    }
    
    return theObject.sendSelf(commitTag, *this);
}
コード例 #2
0
ファイル: FE_Datastore.cpp プロジェクト: aceskpark/osfeo
int 
FE_Datastore::sendObj(int commitTag,
		      MovableObject &theObject, 
		      ChannelAddress *theAddress)
{
  return theObject.sendSelf(commitTag, *this);
}
コード例 #3
0
ファイル: TCP_Socket.cpp プロジェクト: DBorello/OpenSees
int 
TCP_Socket::sendObj(int commitTag,
    MovableObject &theObject, ChannelAddress *theAddress) 
{
    // first check address is the only address a TCP_socket can send to
    SocketAddress *theSocketAddress = 0;
    if (theAddress != 0) {
        if (theAddress->getType() == SOCKET_TYPE) 
            theSocketAddress = (SocketAddress *)theAddress;
        else {
            opserr << "TCP_Socket::sendObj() - a TCP_Socket ";
            opserr << "can only communicate with a TCP_Socket";
            opserr << " address given is not of type SocketAddress\n"; 
            return -1;	    
        }		    

        if (bcmp((char *) &other_Addr.addr_in, (char *) &theSocketAddress->address.addr, 
            theSocketAddress->addrLength) != 0) {

                opserr << "TCP_Socket::sendObj() - a TCP_Socket ";
                opserr << "can only communicate with one other TCP_Socket";
                opserr << " address given is not that address\n"; 
                return -1;	    
        }	
    }

    return theObject.sendSelf(commitTag, *this);
}
コード例 #4
0
ファイル: FileChannel.cpp プロジェクト: DBorello/OpenSees
int FileChannel::sendObj(int commitTag,
			MovableObject &theObject, 
	   	  ChannelAddress *theAddress){
  if ( !theFile )
	return -1;

  return theObject.sendSelf(commitTag, *this); 
}
コード例 #5
0
ファイル: MPI_Channel.cpp プロジェクト: lge88/OpenSees
int 
MPI_Channel::sendObj(int commitTag,
		     MovableObject &theObject, 
		    ChannelAddress *theAddress) 
{
    // first check address is the only address a MPI_Channel can send to
    MPI_ChannelAddress *theMPI_ChannelAddress = 0;
    if (theAddress != 0) {
      if (theAddress->getType() == MPI_TYPE) {
	theMPI_ChannelAddress = (MPI_ChannelAddress *)theAddress;
	otherTag = theMPI_ChannelAddress->otherTag;
	otherComm= theMPI_ChannelAddress->otherComm;
      }
	else {
	    opserr << "MPI_Channel::sendObj() - a MPI_Channel ";
	    opserr << "can only communicate with a MPI_Channel";
	    opserr << " address given is not of type MPI_ChannelAddress\n"; 
	    return -1;	    
	}		    
    }    
    return theObject.sendSelf(commitTag, *this);
}