| 134 | } |
| 135 | |
| 136 | void makeRequest() |
| 137 | { |
| 138 | mSocket = NetSocket::INVALID; |
| 139 | mDataReceived = 0; |
| 140 | |
| 141 | // Hook into the signals. |
| 142 | Net::smConnectionNotify .notify(this, &JournalHandle::notify); |
| 143 | Net::smConnectionReceive.notify(this, &JournalHandle::receive); |
| 144 | |
| 145 | // Open a TCP connection to garagegames.com |
| 146 | mSocket = Net::openConnectTo("72.246.107.193:80"); |
| 147 | |
| 148 | // Let the callbacks enable things to process. |
| 149 | while(Process::processEvents()) {} |
| 150 | |
| 151 | // Unhook from the signals. |
| 152 | Net::smConnectionNotify .remove(this, &JournalHandle::notify); |
| 153 | Net::smConnectionReceive.remove(this, &JournalHandle::receive); |
| 154 | |
| 155 | EXPECT_GT(mDataReceived, 0) |
| 156 | << "Didn't get any data back!"; |
| 157 | } |
| 158 | }; |
| 159 | |
| 160 | TEST(Net, JournalTCPRequest) |