Changeset 119 for branches/follower

Show
Ignore:
Timestamp:
12/19/07 04:51:41 (13 months ago)
Author:
follower
Message:

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\!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde

    r118 r119  
    235235    SOCKET _socket; 
    236236    static const int _MAX_SOCKETS = MAX_SOCK_NUM; // TODO: Use this. 
     237    static int _nextSocket; 
    237238}; 
    238239 
     240int NetworkConnection::_nextSocket = 0; 
     241 
    239242NetworkConnection::NetworkConnection(uint16_t port) { 
    240243  /* 
    241244 
    242245   */ 
    243   _socket = 0; // TODO: Do properly   
     246  _socket = _nextSocket; // TODO: Do properly (& max) 
     247  _nextSocket++; 
    244248  socket(_socket, Sn_MR_TCP, port, 0); 
    245249}