Nube here:
My WIFI server sketch running in a MEGA 2560 refuses to take on a C# DOT NET Client.
My C# DOT NET server/client strategy works through my Wireless Router as intended but the (with a revised port number) C# Client is just ignored by my "connected" WiFi Shield....
And yes, my wireless router maps Port 8021 to 192.168.0.21:8021
UPLOADED SKETCH OUTPUT TO THE SERIAL MONITOR:
Attempting to connect to WPA network...
SSID: 7E8E7F
WIFI Shield Firmware: 1.1.0
Connected to network
192.168.0.21
#include <SPI.h>
#include <WiFi.h>
char ssid[] = "xxxxxx"; // your network SSID (name)
char pass[] = "xxxxxxxxxxxx"; // your network password
int status = WL_IDLE_STATUS;
char c;
WiFiServer server(8021);
IPAddress ip(192,168,0,21);
// the dns server ip
IPAddress dnServer(208, 67, 220, 220);
// the router's gateway address:
IPAddress gateway(192, 168, 0, 1);
// the subnet:
IPAddress subnet(255, 255, 255, 0);
void setup() {
// initialize serial:
Serial.begin(9600);
Serial.println("Attempting to connect to WPA network...");
Serial.print("SSID: ");
Serial.println(ssid);
WiFi.config(ip, dnServer, gateway, subnet);
Serial.print("WIFI Shield Firmware: ");
Serial.println( WiFi.firmwareVersion());
status = WiFi.begin(ssid, pass);
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
while(true);
}
else {
Serial.println("Connected to network");
IPAddress myAddress = WiFi.localIP();
Serial.println(myAddress);
server.begin();
}
}
void loop() {
// listen for incoming clients
WiFiClient client = server.available();
if (client == true) {
Serial.println("new client");
while( client.connected())
{
if( client.available() )
{
// read bytes from the incoming client and write them back
// to any clients connected to the server:
c = client.read();
Serial.write(c);
server.write(c);
}
}
client.stop();
}
}