aboutsummaryrefslogtreecommitdiff
path: root/libraries/Ethernet/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/Ethernet/Client.cpp')
-rw-r--r--libraries/Ethernet/Client.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/Ethernet/Client.cpp b/libraries/Ethernet/Client.cpp
index 9d3e0df..6c19b8f 100644
--- a/libraries/Ethernet/Client.cpp
+++ b/libraries/Ethernet/Client.cpp
@@ -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;