| 1014 | |
| 1015 | |
| 1016 | int GenericClient::setupConnection() |
| 1017 | { |
| 1018 | // setup the connection |
| 1019 | if (udp) { |
| 1020 | if (machineInetAddr == 0) |
| 1021 | theChannel = new UDP_Socket(port, "127.0.0.1"); |
| 1022 | else |
| 1023 | theChannel = new UDP_Socket(port, machineInetAddr); |
| 1024 | } |
| 1025 | #ifdef SSL |
| 1026 | else if (ssl) { |
| 1027 | if (machineInetAddr == 0) |
| 1028 | theChannel = new TCP_SocketSSL(port, "127.0.0.1"); |
| 1029 | else |
| 1030 | theChannel = new TCP_SocketSSL(port, machineInetAddr); |
| 1031 | } |
| 1032 | #endif |
| 1033 | else { |
| 1034 | if (machineInetAddr == 0) |
| 1035 | theChannel = new TCP_Socket(port, "127.0.0.1"); |
| 1036 | else |
| 1037 | theChannel = new TCP_Socket(port, machineInetAddr); |
| 1038 | } |
| 1039 | if (!theChannel) { |
| 1040 | opserr << "GenericClient::setupConnection() " |
| 1041 | << "- failed to create channel\n"; |