Changeset 101 for branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde
- Timestamp:
- 12/10/07 04:19:27 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde
r100 r101 216 216 /* ----------------------- */ 217 217 218 /* ---- NetworkConnection ---- */ 219 220 221 // TODO: Make this 'NetworkServerConnection'? Or just 'ServerConnection'? 222 class NetworkConnection { // Essentially a Socket wrapper 223 224 public: 225 NetworkConnection(uint8_t port); // TODO: Add UDP, TCP choice? 226 227 void listen(); // TODO: Return a useful value? 228 229 private: 230 SOCKET _socket; 231 }; 232 233 NetworkConnection::NetworkConnection(uint8_t port) { 234 /* 235 236 */ 237 socket(_socket, Sn_MR_TCP, port, 0); 238 } 239 240 void NetworkConnection::listen() { // TODO: Make private or protected? 241 /* 242 243 */ 244 ::listen(_socket); // TODO: Use C++ namespaces for the driver functions? 245 } 246 247 /* ----------------------- */ 248 218 249 /* -- NetworkInterface -- */ 219 250 … … 222 253 public: 223 254 NetworkInterface(Wiz810MjDevice& networkDevice); 255 256 NetworkConnection listen(uint8_t port); 224 257 225 258 Wiz810MjDevice& device; // TODO: Make this a generic "network device" interface … … 248 281 }; 249 282 283 NetworkConnection NetworkInterface::listen(uint8_t port) { 284 /* 285 286 287 Returns a NetworkConnection listening on the specified TCP port. 288 289 */ 290 NetworkConnection connection = NetworkConnection(port); 291 292 connection.listen(); 293 294 return connection; 295 } 296 250 297 // NetworkInterface Network = NetworkInterface(...); // TODO: Make this a global 251 298 252 299 /* ----------------------- */ 253 254 300 255 301 // #define PIN_RESET 9 // WIZnet module /RESET