Originating each outgoing network connection from a different source port (in the Client class of the Ethernet library).

Updating readme and todo.
This commit is contained in:
David A. Mellis 2009-01-07 21:16:45 +00:00
parent 1cee12bada
commit c0550aac8c
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,8 @@ extern "C" {
#include "Client.h"
#include "Server.h"
uint16_t Client::_srcport = 0;
Client::Client(uint8_t sock) {
_sock = sock;
}
@ -29,8 +31,10 @@ uint8_t Client::connect() {
if (_sock == 255)
return 0;
_srcport++;
// XXX: what port should we connect from?
socket(_sock, Sn_MR_TCP, _port, 0);
socket(_sock, Sn_MR_TCP, _port, 1024 + _srcport);
if (!::connect(_sock, _ip, _port))
return 0;

View File

@ -5,6 +5,7 @@
class Client : public Print {
private:
static uint16_t _srcport;
uint8_t _sock;
uint8_t *_ip;
uint16_t _port;