Connection questions

32 views
Skip to first unread message

Ravenheart

unread,
Apr 22, 2010, 1:53:30 PM4/22/10
to lidgren-network
Hey guys I'm making a small test app that rapidly captures screenshots
of the desktop and sends them over the network. Now when I test
locally in my home network between my two computers, using
"192.168.1.103" as the server IP everything works fine. However if I
try to set the IP to "87.120.1.37" which is my external IP I get this
error:

"Socket Exception was unhandled by user code

The requested address is not valid in its context"

This occurs in the NetBase.cs file, method "public void
Start(IPAddress localAddress)" which is at line 214.


Here is my server implementation, and yes I do know its not the proper
way to do this:
http://pastebin.com/dxJXkrGL

And my client:
http://pastebin.com/V2g2F6t0

I'm 100% sure I've messed up something somewhere, also keep in mind
only one person will connect to the server.

--
You received this message because you are subscribed to the Google Groups "lidgren-network" group.
To post to this group, send email to lidgren...@googlegroups.com.
To unsubscribe from this group, send email to lidgren-netwo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lidgren-network?hl=en.

Chris Cowherd

unread,
Apr 22, 2010, 4:13:53 PM4/22/10
to lidgren...@googlegroups.com
Does your server have a NAT'd address? Is this the public IP of the router that the server is behind?  Or is your computer connected directly to the Internet?

The server can't bind to that address if it is the address of your router.  Just my first guess.

Ravenheart

unread,
Apr 22, 2010, 4:43:03 PM4/22/10
to lidgren-network
87.120.1.37 is my external IP, the router itself uses 192.168.1.1 and
yes I have forwarded the correct port to my computer(which has a
static internal IP).
> > lidgren-netwo...@googlegroups.com<lidgren-network%2Bunsubscribe@­googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/lidgren-network?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "lidgren-network" group.
> To post to this group, send email to lidgren...@googlegroups.com.
> To unsubscribe from this group, send email to lidgren-netwo...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/lidgren-network?hl=en.

lidgren

unread,
Apr 22, 2010, 4:48:15 PM4/22/10
to lidgren-network
I agree with Chris. You only need to set the address in the config (or
use the Start(IPAddress) override) if you have multiple network cards
- the external ip will be automatically chosen by the router, it
cannot be chosen.

--michael
Reply all
Reply to author
Forward
0 new messages