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

Method recvObj

SRC/actor/channel/UDP_Socket.cpp:349–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347
348
349int
350UDP_Socket::recvObj(int commitTag,
351 MovableObject &theObject, FEM_ObjectBroker &theBroker,
352 ChannelAddress *theAddress)
353{
354 int res = theObject.recvSelf(commitTag, *this, theBroker);
355 if (res < 0)
356 return res;
357
358 // check the address that message came from was correct
359 if (theAddress != 0) {
360 SocketAddress *theSocketAddress = 0;
361
362 if (theAddress->getType() == SOCKET_TYPE) {
363 theSocketAddress = (SocketAddress *)theAddress;
364
365 if (memcmp((char *) &theSocketAddress->address.addr, (char *) &other_Addr.addr,
366 theSocketAddress->addrLength) != 0) {
367 opserr << "UDP_Socket::recvObj() - a UDP_Socket ";
368 opserr << "can only look at first incoming message\n";
369 opserr << "The last message did not come from write scource\n";
370 return -1;
371 }
372 }
373 else {
374 opserr << "UDP_Socket::recvObj() - a UDP_Socket ";
375 opserr << "can only communicate with a UDP_Socket";
376 opserr << " address given is not of type SocketAddress\n";
377 return -1;
378 }
379 }
380
381 return 0;
382}
383
384
385int

Callers 2

recvObjectMethod · 0.45
recvObjectMethod · 0.45

Calls 2

recvSelfMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected