Hello Angus,
I have a SocketServer because it's the way to make a listening UDP
server isn't it ? It listen for incoming UDP on port 1812, I
subclassed it to add some more properties. When OnDataAvailable I try
to send UDP data back to sender but with same 1812 src port and
I have a SocketServer because it's the way to make a listening
UDP server isn't it ?
No!!
TSocketServer is designed for TCP, not UDP, it listens on a port for a
new connection then transfers that connection to a new socket for each
client.
UDP is connectionless and only supports
And he used TWSocketServer
and since then I always used the same way too.
No idea how that worked, maybe the client was using a different port to
reply.
TMySocketServer
If you have been making use of the TSocketServer client to save
application data for the reply, you'll need a rethink.
Hello Angus,
ARMSL No idea how that worked, maybe the client was using a different port to
ARMSL reply.
Absolutely, my other programs never needed to re-use same src port so
I never got the problem.
ARMSL If you have been making use of the TSocketServer client to save
ARMSL application data
: [twsocket] Force UDP source port when sending
Hello Angus,
ARMSL No idea how that worked, maybe the client was using a different port
to
ARMSL reply.
Absolutely, my other programs never needed to re-use same src port so
I never got the problem.
ARMSL If you have been making use
] Force UDP source port when sending
HS Hello Angus,
ARMSL No idea how that worked, maybe the client was using a different port
HS to
ARMSL reply.
HS Absolutely, my other programs never needed to re-use same src port so
HS I never got the problem.
ARMSL If you have been making use
Hello Angus,
Still not working but I found something, if I do a .SendTo inside the
OnDataAvailable after the .ReceiveFrom, it works, no bind error, but
in my program I have to pass the received data to some worker queue
that take some seconds to produce the answer and then when it tries to
May be I need to do something more if I .SendTo outside
OnDataAvailable ?
I would have thought not, but make sure the public variable is not being
corrupted by another received packet meanwhile, it should be kept for the
FIFO queue.
I use SendTo in my IP Logger component, which will send and
Hello Angus,
I just tested it on a Vista machine and it works, no bind error, back
to the original NT4 machine (I know its old but we still use some
NT4 servers that work perfectly) and I get bind error ?!?
regards.
--
To unsubscribe or change your settings for TWSocket mailing list
please
Hello Angus,
Just for experience, I tried with my old bad TWSocketServer way of
use, and get the bind error under Vista/XP too, so your advices has
been very helpfull as I can now make it work under Vista/XP, but I
need to make it work on NT4 :-(
regards.
--
To unsubscribe or change
Hello Angus,
I still get Bind error using this (simplified) code :-(
procedure TFormMain.WSocketListenerDataAvailable(Sender: TObject;
ErrCode: Word);
begin
TMySocketServer(sender).ReceiveFrom(@BufRadiusAnswerDataAvailable,512,SrcSocket,SrcSocketLen);
try
TMySocketServer
Why are you using this component, UDP needs only TWSocket, or have you
subclassed TWSocket for some reason?
But this stuff works in numerous other applications, there must be
something else in error in your application that is causing bind to fail.
Angus
--
To unsubscribe
Hello Angus,
Thank you, so I cannot force the port to same as listening but if I do
it within the OnDataAvailable then the .SendTo will automatically
re-use the same socket to send data back using same src port whenever
this port is actually used for listening by the server ?
So this also
: [twsocket] Force UDP source port when sending
*From:* Dod [EMAIL PROTECTED]
*To:* ICS support mailing twsocket@elists.org
*Date:* Sat, 28 Jun 2008 18:06:32 +0200
Hello Angus,
Thank you, so I cannot force the port to same as listening but if I do
it within the OnDataAvailable then the .SendTo
Hello,
I have an application (EXE file without sources) that listen UDP on
port 1812 and when it receive data, it send an UDP paquet back to
sender with same source 1812 port.
I have to do same application but I get exception already binded if
I use MySocket.LocalPort:=1812 to send
So question is : how to force UDP port source when sending it whenever
this port is used by a listener socket as the other application do ?
May be thru sockaddr_in structure ?
Yes, this is the (simplified) code from the ICS SNTP Time Server that
responds to a UDP request with the time to the
16 matches
Mail list logo