D
ducnbyu
I'm considering a midp application using Datagrams. The javadoc seems
to make sense except one part:
Quote
Note that the port number in "server mode" (unspecified host name) is
that of the receiving port. The port number in "client mode" (host name
specified) is that of the target port. The reply-to port in both cases
is never unspecified. In "server mode", the same port number is used
for both receiving and sending. In "client mode", the reply-to port is
always dynamically allocated.
End Quote
Can I use the same client mode DatagramConnection object to receive as
in:
DatagramConnection dc =
(DatagramConnection)Connector.open("datagram://<host>:"+hostport);
DataGram dgreceive = dc.newDatagram(dc.getMaximumLength());
Datagram dgssend = dc.newDatagram(some length);
<populate dgsend>
dc.send(dgsend);
dc.receive(dgreceive);
My intention is to thread the application, the above is just for
demonstration purposes.
Thanks for your help in clearing up any misunderstandings I might have.
to make sense except one part:
Quote
Note that the port number in "server mode" (unspecified host name) is
that of the receiving port. The port number in "client mode" (host name
specified) is that of the target port. The reply-to port in both cases
is never unspecified. In "server mode", the same port number is used
for both receiving and sending. In "client mode", the reply-to port is
always dynamically allocated.
End Quote
Can I use the same client mode DatagramConnection object to receive as
in:
DatagramConnection dc =
(DatagramConnection)Connector.open("datagram://<host>:"+hostport);
DataGram dgreceive = dc.newDatagram(dc.getMaximumLength());
Datagram dgssend = dc.newDatagram(some length);
<populate dgsend>
dc.send(dgsend);
dc.receive(dgreceive);
My intention is to thread the application, the above is just for
demonstration purposes.
Thanks for your help in clearing up any misunderstandings I might have.