From b2ed21239a611eacf5a19058034deea50448c2b6 Mon Sep 17 00:00:00 2001 From: follower Date: Wed, 19 Dec 2007 12:51:41 +0000 Subject: [PATCH] Add rough hacky method to allow multiple sockets to be created. This needs to be fixed to (a) not create more than MAX sockets and (b) reuse sockets that have been closed. TODO: DO THIS PROPERLY\! git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@119 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b --- branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde b/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde index 873fbce..aec5081 100644 --- a/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde +++ b/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde @@ -234,13 +234,17 @@ class NetworkConnection { // Essentially a Socket wrapper private: SOCKET _socket; static const int _MAX_SOCKETS = MAX_SOCK_NUM; // TODO: Use this. + static int _nextSocket; }; +int NetworkConnection::_nextSocket = 0; + NetworkConnection::NetworkConnection(uint16_t port) { /* */ - _socket = 0; // TODO: Do properly + _socket = _nextSocket; // TODO: Do properly (& max) + _nextSocket++; socket(_socket, Sn_MR_TCP, port, 0); }