Answer the question
In order to leave comments, you need to log in
Transferring data with closed ports?
There is a D-Link DIR-300NRU rev.B7 router.
Ports do not open: UPnP enabled, added virtual servers.
Saved, rebooted, no change. Also, just added to the firewall exceptions.
I found the info that the torrent opens a certain port while it is running. I tried to send a message through an open port - 55585.
Server:
TcpListener server = null;
try
{
Int32 port = 55585;
IPAddress localAddr = IPAddress.Parse("127.0.0.1");
server = new TcpListener(localAddr, port);
server.Start();
Byte[] bytes = new Byte[256];
String data = null;
while (true)
{
Console.Write("Waiting for a connection... ");
TcpClient client = server.AcceptTcpClient();
Console.WriteLine("Connected!");
data = null;
NetworkStream stream = client.GetStream();
int i;
while ((i = stream.Read(bytes, 0, bytes.Length)) != 0)
{
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
Console.WriteLine("Received: {0}", data);
byte[] msg = System.Text.Encoding.ASCII.GetBytes(data);
stream.Write(msg, 0, msg.Length);
Console.WriteLine("Sent: {0}", data);
}
client.Close();
}
}
catch (SocketException e)
{
Console.WriteLine("SocketException: {0}", e);
}
finally
{
server.Stop();
}
Console.WriteLine("\nHit enter to continue...");
Console.Read();
static void Main(string[] args)
{
try
{
string tmp1 = Console.ReadLine();
string tmp = Console.ReadLine();
Connect(tmp1, tmp);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
finally
{
Console.ReadLine();
}
}
static void Connect(String server, String message)
{
try
{
Int32 port = 55585;
TcpClient client = new TcpClient(server, port);
Byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
NetworkStream stream = client.GetStream();
stream.Write(data, 0, data.Length);
Console.WriteLine("Sent: {0}", message);
data = new Byte[256];
String responseData = String.Empty;
Int32 bytes = stream.Read(data, 0, data.Length);
responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes);
Console.WriteLine("Received: {0}", responseData);
stream.Close();
client.Close();
}
catch (ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException: {0}", e);
}
catch (SocketException e)
{
Console.WriteLine("SocketException: {0}", e);
}
Console.WriteLine("\n Press Enter to continue...");
Console.Read();
}
Answer the question
In order to leave comments, you need to log in
Am I missing something or have you opened 27015 on the router for external connections, but are you trying to connect to port 55585 from the outside?
Well, judging by the screenshot, you are forwarding the ports incorrectly: if you need access to the computer's port 55585 from the outside, add it in the "Internal port" field in the router. And try to connect to an external port (you have it 27015).
Is 192.168.0.100 exactly the IP of the computer on the internal network?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question