MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / sendObj

Method sendObj

SRC/actor/channel/TCP_Socket.cpp:322–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321
322int
323TCP_Socket::sendObj(int commitTag,
324 MovableObject &theObject, ChannelAddress *theAddress)
325{
326 // first check address is the only address a TCP_socket can send to
327 SocketAddress *theSocketAddress = 0;
328 if (theAddress != 0) {
329 if (theAddress->getType() == SOCKET_TYPE)
330 theSocketAddress = (SocketAddress *)theAddress;
331 else {
332 opserr << "TCP_Socket::sendObj() - a TCP_Socket ";
333 opserr << "can only communicate with a TCP_Socket";
334 opserr << " address given is not of type SocketAddress\n";
335 return -1;
336 }
337
338 if (memcmp((char *) &other_Addr.addr_in, (char *) &theSocketAddress->address.addr,
339 theSocketAddress->addrLength) != 0) {
340
341 opserr << "TCP_Socket::sendObj() - a TCP_Socket ";
342 opserr << "can only communicate with one other TCP_Socket";
343 opserr << " address given is not that address\n";
344 return -1;
345 }
346 }
347
348 return theObject.sendSelf(commitTag, *this);
349}
350
351
352int

Callers

nothing calls this directly

Calls 2

getTypeMethod · 0.45
sendSelfMethod · 0.45

Tested by

no test coverage detected