473,699 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TcpListener with external/internet IP?

I have a test application that transfers files from a client to a
server. I've been locally testing this on my local LAN and it has been
working fine. However, when I try to transfer a file over the internet
(with the port opened up in the router, no firewalls), it never
connects. I'm thinking it is due to the TcpListener only binding to my
local LAN ip. I tried binding it to my internet IP manually and by
using gethostbyname(g ethostname).add resslist(0) as well as using
ipaddress.any, but the client never connects to my machine. An error
occurs on the client's end saying it wasn't able to connect and timed
out, etc, etc.

Is there something I'm missing? Any help is greatly appreciated. Thanks
in advance

Sep 20 '06 #1
3 2074
Hello ms****@gmail.co m,

You have to tell your router to forward any incoming packets on port (whatever)
to your internal address. Check your router manual for NAT settings.

-Boo
I have a test application that transfers files from a client to a
server. I've been locally testing this on my local LAN and it has been
working fine. However, when I try to transfer a file over the internet
(with the port opened up in the router, no firewalls), it never
connects. I'm thinking it is due to the TcpListener only binding to my
local LAN ip. I tried binding it to my internet IP manually and by
using gethostbyname(g ethostname).add resslist(0) as well as using
ipaddress.any, but the client never connects to my machine. An error
occurs on the client's end saying it wasn't able to connect and timed
out, etc, etc.

Is there something I'm missing? Any help is greatly appreciated.
Thanks in advance

Sep 20 '06 #2
I've done that already. I have it forwarding both TCP and UDP even to
my internal IP.

Sep 21 '06 #3
Nevermind, it seems I overlooked a previous entry in my port forwarding
where I had used the same test port before and had it forwarded to
another machine on my LAN. Changed that, and works great now.

Sep 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1813
by: Doug Wyatt | last post by:
So I'll preface this with the fact that I'm a UNIX developer by training and have just recently gotten in to C# development on Windows. I'm basically running in to a problem whereby I suspect something to do with process groups or threads and closeOnExec semantics (to speak in POSIX terms) is causing me a problem. I've got a windows service (let's call it "myService") that, among other things, does : onStart creates a TcpListener on a...
4
4397
by: Rob White | last post by:
OK, so I have a TcpListener that is waiting for sockets, this piece of code: IPAddress localAddress = Dns.GetHostByName(Dns.GetHostName()).AddressList; IPEndPoint localEP = new IPEndPoint(localAddress, 9000); TcpListener tcpListen = new TcpListener(localEP); tcpListen.Start(); Socket skt = tcpListen.AcceptSocket(); .... do some socket stuff skt.Close();
0
1253
by: Wizou | last post by:
1. Create a TcpListener 2. Start a child Process 3. Kill the parent process => You can't bind to the port until you close the child process Variant : 3. Terminate normally the parent process => The parent process stays as "Running" until the child process is closed
2
4660
by: Dave Coate | last post by:
Hi, I am working on a client-server app. I can get two applications to talk to each other on the same machine using 127.0.0.1, but as soon as I try it using a computer name or actual IP address I get a SocketException: "No connection could be made because the target machine actively refused it". On the server I have a listener: Private m_Listener As TcpListener m_Listener = New TcpListener(IPAddress.Parse("127.0.0.1"), 8000)
1
2262
by: mb | last post by:
Hi, I picked up this JavaScript code (quiz code) at: http://javascript.internet.com/miscellaneous/multiple-choice-quiz.html and modified it (and may have deleted some line I shouldn't have) so that it looks like this on my web site: http://www.goalseek.net/Scripts/qa_XL_History.htm
5
4012
by: Jerry Spence1 | last post by:
I have the following example of a tcpListener. I have a device external to my PC which is sending a TCP request on port 10002. This is working OK as I have a network sniffer on my PC and can see the data. This code hangs whilst waiting for a connection on the Dim tcpCli As TcpClient = tcpList.AcceptTcpClient() line and doesn't hear the incoming request. I am wondering if this example code assumes that the client is on the same PC as the...
3
4359
by: Bjørn Eliasen | last post by:
Hi, I have an application running on all pc's in our company. Basically it is a TCPListener awaiting for sockets to connect and on connection performs the required tasks. The app works fine, but while the listener is awaiting for socket to connect several other applications can't start, and even installation of new applications migth hang. In order to finalise the other apps or installations the tcp listener is killed resulting in the other...
3
6760
by: Jon Slaughter | last post by:
I can't seem to get these to work over my router. I have all the ports open and ftp works from outside. Is there anything special I have to do or what? (my app does work over the LAN though) I'm using the bare basics and the app is very simple. I was just trying to see how hard it was to do. // sends and recieves text. private void button1_Click(object sender, EventArgs e) { richTextBox1.AppendText(UserName + ": " + richTextBox2.Text +
1
8630
by: Darwin | last post by:
Setting a server to listen on 8080 for incoming connections. Written in VS2005 on a Multi-homed machine. I get the warning: Warning 1 'System.Net.Sockets.TcpListener.TcpListener(int)' is obsolete: 'This method has been deprecated. Please use TcpListener(IPAddress localaddr, int port) instead. on the code: TcpListener tcpListener = new TcpListener(8080); Do I really have to specify every IP address that I want to listen on?
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9034
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8883
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7750
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.