| 458 | |
| 459 | |
| 460 | int |
| 461 | TCP_SocketSSL::setNextAddress(const ChannelAddress &theAddress) |
| 462 | { |
| 463 | SocketAddress *theSocketAddress = 0; |
| 464 | if (theAddress.getType() == SOCKET_TYPE) { |
| 465 | theSocketAddress = (SocketAddress *)(&theAddress); |
| 466 | // check address is the only address a TCP_socket can send to |
| 467 | if (memcmp((char *) &other_Addr.addr_in, (char *) &theSocketAddress->address.addr, |
| 468 | theSocketAddress->addrLength) != 0) { |
| 469 | |
| 470 | opserr << "TCP_SocketSSL::setNextAddress() - a TCP_SocketSSL "; |
| 471 | opserr << "can only communicate with one other TCP_SocketSSL\n"; |
| 472 | return -1; |
| 473 | } |
| 474 | } |
| 475 | else { |
| 476 | opserr << "TCP_SocketSSL::setNextAddress() - a TCP_SocketSSL "; |
| 477 | opserr << "can only communicate with a TCP_SocketSSL"; |
| 478 | opserr << " address given is not of type SocketAddress\n"; |
| 479 | return -1; |
| 480 | } |
| 481 | |
| 482 | return 0; |
| 483 | } |
| 484 | |
| 485 | |
| 486 | int |