This does not work as (I) expected. I see the packet arriving in
Wireshark, but on a port I never specified. Port 59395 that is.


Use this:

INetBroadcast.sin_port  := htons(1000);

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


----- Original Message ----- From: "Stefan Paege" <pa...@el-carls.de>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Saturday, November 14, 2009 5:10 PM
Subject: Re: [twsocket] WSocket.SendTo uses wrong port


Sorry to bother you again.

Can someone please explain to me if there is a bug in the code or if the
problem is located in that grey matter between my ears?

Regards
 Stefan

ICS 7.29, RAD Studio 2007

Using this socket:
  object LanOut: TWSocket
    Addr = '255.255.255.255'
    Port = '1000'
    Proto = 'udp'
    LocalAddr = '0.0.0.0'
    LocalPort = '0'
    MultiThreaded = False
    SendFlags = wsSendNormal
    SocksLevel = '5'
    SocksAuthentication = socksNoAuthentication
  end

I can call:
    LanOut.Send(@Buffer[0], aLen);

This works fine, I see the packet arriving in Wireshark on port 1000.

Now trying the same like this:
  var INetBroadcast: TSockAddrIn;

  INetBroadcast.sin_family := AF_INET;
  INetBroadcast.sin_port := 1000;
  INetBroadcast.sin_addr.S_addr := INADDR_BROADCAST;
  LanOut.SendTo(INetBroadcast, SizeOf(INetBroadcast), @Buffer[0], aLen);

This does not work as (I) expected. I see the packet arriving in
Wireshark, but on a port I never specified. Port 59395 that is.

Is there a fundamental misunderstanding on my side?

Any help welcome.


--


elektronik-labor CARLS GmbH & Co. KG

 Stefan Paege

Fon: +49 5973 9497-23
Fax: +49 5973 9497-19

----

elektronik-labor CARLS GmbH & Co. KG
Kommanditgesellschaft:
Sitz Neuenkirchen, Registergericht Steinfurt HRA 3310

Persönlich haftende Gesellschafterin:
elektronik-labor CARLS, Beteiligungsgesellschaft mbH,
Sitz Neuenkirchen, Registergericht Steinfurt HRB 4175

Geschäftsführer:
Irmgard Carls, Joachim Schulte

--
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
--
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