I cant get socket connection outside the server box

Andreas Mohr andi at rhlx01.hs-esslingen.de
Mon Jul 2 02:47:40 PDT 2007


Hi,

On Mon, Jul 02, 2007 at 08:29:07AM -0000, wx-users-digest-help at lists.wxwidgets.org wrote:
> How do I get a socket connection to another machine on the network?
> Currently, my server and client programs talk fine on the same box,  
> but the external ones can not be reached.
> Using just the local machine name for the local box, which works  
> fine, but neither name or ip work for remote boxes.
> I'm using machine Host Name (as comes back from wxaddress when a  
> listener is established) and direct ip (in dot format).
> Both fail.

I cannot help you on this socket issue directly,
but since wx generic socket implementation is known to have
several race condition issues (insufficient/missing thread locking)
on Linux GTK and Mac (and maybe Win32, too?),
I'd *strongly* suggest migrating your socket code to
very widespread/stable/fast alternative socket libraries if you cannot
get this issue solved otherwise (e.g. libcurl in case of HTTP/FTP-based
transfers, which admittedly won't help your non-HTTP project).

Projects implementing one specific functionality are there for very good
reasons: they do one thing only, and they do it *extremely* well,
and their focused efforts allow them to offer it very broadly (~ > 100
different download versions in the case of libcurl).

I've been through wx socket hell (and hell it was!), and I can assure
you that migrating to libcurl fixed *everything*,
and communication was 10 times(!) faster to boot.

So the conclusion is that for single-threaded apps wx socket
implementation is useful and offers a lot of functionality,
but for socket operation in secondary threads better look elsewhere.

Andreas Mohr




More information about the wx-users mailing list