Hello,

I   have   a  machine  with  only  one  IP  address  and  a  listening
WSocketServer on UDP port XXX.

>From same project I want to send UDP data to an other machine but with
.LocalPort set with same as current listening server port.

On  Win2K,  XP and Vista it works well, UDP data is sent with a forced
src port number same as the listening one, but on NT4 (sp6a) it give a
#10048 Addr already in use.

There is an application on this NT4 machine that already work that way
(I  have  not  the  sources)  Any idea how to do make it work is there
something special to set in socket options ?

I  know  I  already  sent a previous message meaning nearly same but I
forgot  to  tall that an application was already doing it perfectly on
the NT4 machine so there should be a way to do it with ICS.

Thanx for any help.

Here a very small code that can reproduce the problem :

procedure TForm1.Button1Click(Sender: TObject);
begin
  // first we make it listen
  WSocketServer1.Port:='12345';
  WSocketServer1.Proto:='udp';
  WSocketServer1.Addr:='127.0.0.1';
  WSocketServer1.Listen;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  // then we try to send
  WSocket1.LocalPort:='12345';
  WSocket1.Port:='12345';
  WSocket1.Addr:='127.0.0.1';
  WSocket1.Proto:='udp';
  WSocket1.Connect;
  WSocket1.SendStr('hello world');
  WSocket1.Close;
end;

procedure TForm1.WSocketServer1DataAvailable(Sender: TObject; ErrCode:
Word);
begin
  // this trigger nciely on 2K/XP/Vista, not NT4
  showmessage(TWSocketServer(sender).ReceiveStr);
end;

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to