 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Paul Nicholls Guest
|
Posted: Tue Jan 13, 2004 3:46 am Post subject: Re: how to get the udpsocket's OnReceive event? |
|
|
Does TUDPSocket have a bind method?
If so I think you have to call this before sending the data...
UdpSocket1.Bind(...);
UdpSocket1.Sendln('adfsdf'#10#13);
I could be wrong though <G>
"ari" <aiirii (AT) 163 (DOT) net> wrote
| Quote: | hi all,
I have setted the udpsocket's blockMode to bmNonBlocking, but still can't
fire the OnReceive event, please tell me why!
one's is:
object UdpSocket1: TUdpSocket
BlockMode = bmNonBlocking
LocalHost = '127.0.0.1'
LocalPort = '2335'
RemoteHost = '127.0.0.1'
RemotePort = '2400'
OnCreateHandle = UdpSocket1CreateHandle
OnConnect = UdpSocket1Connect
OnDisconnect = UdpSocket1Disconnect
OnReceive = UdpSocket1Receive
OnError = UdpSocket1Error
end
other is:
object UdpSocket1: TUdpSocket
BlockMode = bmNonBlocking
LocalHost = '127.0.0.1'
LocalPort = '2400'
RemoteHost = '127.0.0.1'
RemotePort = '2335'
OnConnect = UdpSocket1Connect
OnDisconnect = UdpSocket1Disconnect
OnSend = UdpSocket1Send
OnError = UdpSocket1Error
end
procedure TForm1.Button1Click(Sender: TObject);
begin
UdpSocket1.Sendln('adfsdf'#10#13);
end
regards,
Ari
|
|
|
| Back to top |
|
 |
ari Guest
|
Posted: Tue Jan 13, 2004 3:46 am Post subject: how to get the udpsocket's OnReceive event? |
|
|
hi all,
I have setted the udpsocket's blockMode to bmNonBlocking, but still can't
fire the OnReceive event, please tell me why!
one's is:
object UdpSocket1: TUdpSocket
BlockMode = bmNonBlocking
LocalHost = '127.0.0.1'
LocalPort = '2335'
RemoteHost = '127.0.0.1'
RemotePort = '2400'
OnCreateHandle = UdpSocket1CreateHandle
OnConnect = UdpSocket1Connect
OnDisconnect = UdpSocket1Disconnect
OnReceive = UdpSocket1Receive
OnError = UdpSocket1Error
end
other is:
object UdpSocket1: TUdpSocket
BlockMode = bmNonBlocking
LocalHost = '127.0.0.1'
LocalPort = '2400'
RemoteHost = '127.0.0.1'
RemotePort = '2335'
OnConnect = UdpSocket1Connect
OnDisconnect = UdpSocket1Disconnect
OnSend = UdpSocket1Send
OnError = UdpSocket1Error
end
procedure TForm1.Button1Click(Sender: TObject);
begin
UdpSocket1.Sendln('adfsdf'#10#13);
end
regards,
Ari
|
|
| Back to top |
|
 |
ari Guest
|
Posted: Tue Jan 13, 2004 4:38 am Post subject: Re: how to get the udpsocket's OnReceive event? |
|
|
to Paul,
I can't find UdpSocket1.Bind!
regards,
Ari
"Paul Nicholls" <paul-nicholls (AT) hotmail (DOT) com> 在郵件
news:400369f2$1 (AT) newsgroups (DOT) borland.com 中撰寫...
| Quote: | Does TUDPSocket have a bind method?
If so I think you have to call this before sending the data...
UdpSocket1.Bind(...);
UdpSocket1.Sendln('adfsdf'#10#13);
I could be wrong though
|
|
|
| Back to top |
|
 |
Paul Nicholls Guest
|
Posted: Tue Jan 13, 2004 4:41 am Post subject: Re: how to get the udpsocket's OnReceive event? |
|
|
<G> Well I did ask the question 'Does TUDPSocket have a bind method?'
I don't know the component so that is why I asked...<G>
Sorry, I can't help you then :-)
"ari" <aiirii (AT) 163 (DOT) net> wrote
| Quote: | to Paul,
I can't find UdpSocket1.Bind!
regards,
Ari
"Paul Nicholls" <paul-nicholls (AT) hotmail (DOT) com> 在郵件
news:400369f2$1 (AT) newsgroups (DOT) borland.com 中撰寫...
Does TUDPSocket have a bind method?
If so I think you have to call this before sending the data...
UdpSocket1.Bind(...);
UdpSocket1.Sendln('adfsdf'#10#13);
I could be wrong though
|
|
|
| Back to top |
|
 |
Antti Arola Guest
|
Posted: Sat Jan 24, 2004 8:09 pm Post subject: Re: how to get the udpsocket's OnReceive event? |
|
|
ari <aiirii (AT) 163 (DOT) net> kirjoitti Tue, 13 Jan 2004 11:46:53 +0800:
| Quote: | hi all,
I have setted the udpsocket's blockMode to bmNonBlocking, but still can't
fire the OnReceive event, please tell me why!
|
I have the same problem, and the cause seems to be that LocalPort property
does nothing in the component.
UdpSocket always goes to a dynamically allocated local port, and it
doesn't reflect the LocalPort contents in any way.
Does somebody have a fix?
antti
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|