| 350 | |
| 351 | |
| 352 | int |
| 353 | TCP_Socket::recvObj(int commitTag, |
| 354 | MovableObject &theObject, FEM_ObjectBroker &theBroker, |
| 355 | ChannelAddress *theAddress) |
| 356 | { |
| 357 | // first check address is the only address a TCP_socket can send to |
| 358 | SocketAddress *theSocketAddress = 0; |
| 359 | if (theAddress != 0) { |
| 360 | if (theAddress->getType() == SOCKET_TYPE) |
| 361 | theSocketAddress = (SocketAddress *)theAddress; |
| 362 | else { |
| 363 | opserr << "TCP_Socket::recvObj() - a TCP_Socket "; |
| 364 | opserr << "can only communicate with a TCP_Socket"; |
| 365 | opserr << " address given is not of type SocketAddress\n"; |
| 366 | return -1; |
| 367 | } |
| 368 | if (memcmp((char *) &other_Addr.addr_in, (char *) &theSocketAddress->address.addr, |
| 369 | theSocketAddress->addrLength) != 0) { |
| 370 | |
| 371 | opserr << "TCP_Socket::recvObj() - a TCP_Socket "; |
| 372 | opserr << "can only communicate with one other TCP_Socket\n"; |
| 373 | return -1; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | return theObject.recvSelf(commitTag, *this, theBroker); |
| 378 | } |
| 379 | |
| 380 | |
| 381 | // void Recv(Message &): |