[Q] how to setup specific ip address for wxIPV4address object.
Hugo Jackson
hugojackson at speedfactory.net
Mon Apr 9 10:59:48 PDT 2007
hi...
my experience is that you can bind to a specific address in wxGTK and
wxMSW but you can't bind to a specific address in wxMAC.
For those machines that seem to allow binding to a specific port you
would write something like:
wxIPV4address boundAddress;
boundAddress.Hostname( _T( "234.124.2.23" ) ); // or whatever address
you want
boundAddress.Service( 128 ); // or whatever port you want
wxSocketClient* socketClient = new wxSocketClient();
socketClient->Connect( boundAddress ); // etc.
On Apr 9, 2007, at 1:40 PM, Yu Hui Yang wrote:
> Hi, there
>
> I am new to wxWidget. I think this is a basic question, but I can't
> find clue in the list...
> I want to build a program which only listens on a specific ip address
> on my machine. I have got the ip list of my machine, but I didn't find
> method of wxIPV4address to setup this socket address object. What I
> tried was:
>
> wxIPV4address local;
> local.LocalHost(); // only bind to 127.0.0.1
> local.AnyAddress(); // bind to all ip of my machine
>
> Could someone give me a clue, please... Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
More information about the wx-users
mailing list