| 126 | } |
| 127 | |
| 128 | inline dmSocket::Socket GetSocket(dmSocket::Domain domain) |
| 129 | { |
| 130 | dmSocket::Socket instance = 0; |
| 131 | uint64_t timeout = 3000; // milliseconds |
| 132 | dmSocket::Result result = dmSocket::RESULT_OK; |
| 133 | |
| 134 | result = dmSocket::New(domain, dmSocket::TYPE_STREAM, dmSocket::PROTOCOL_TCP, &instance); |
| 135 | if (result != dmSocket::RESULT_OK) return -1; |
| 136 | |
| 137 | result = dmSocket::SetSendTimeout(instance, timeout); |
| 138 | if (result != dmSocket::RESULT_OK) return -1; |
| 139 | |
| 140 | result = dmSocket::SetReceiveTimeout(instance, timeout); |
| 141 | if (result != dmSocket::RESULT_OK) return -1; |
| 142 | |
| 143 | result = dmSocket::SetNoDelay(instance, true); |
| 144 | if (result != dmSocket::RESULT_OK) return -1; |
| 145 | |
| 146 | result = dmSocket::SetQuickAck(instance, true); |
| 147 | if (result != dmSocket::RESULT_OK) return -1; |
| 148 | |
| 149 | return instance; |
| 150 | } |
| 151 | |
| 152 | TEST(Socket, BitDifference_Difference) |
| 153 | { |
no test coverage detected