To create a server connection:
we have to do:
service = (StreamConnectionNotifier) Connector.open(url);
con = (StreamConnection) service.acceptAndOpen();
I don't know why we have to do these,
my question:
why convert StreamConnectionNotifier(service) to StreamConnection(con) ?
It seems that when we implement a client code, we don't have to do that,
isn't it ?:)
ex: we only have to do this:
StreamConnection con = (StreamConnection) Connector.open( url );
Best regards,
Boki.
Thomas Hawtin - 04 Nov 2005 05:52 GMT
> To create a server connection:
> we have to do:
[quoted text clipped - 11 lines]
> ex: we only have to do this:
> StreamConnection con = (StreamConnection) Connector.open( url );
It might help to mention that these interfaces are in the
javax.microedition.io package. They are roughly equivalent to
java.net.ServerSocket and Socket.
In general, to receive an incoming connection you need to tell the
operating system that you are prepared to accept that service. An
incoming connection should be dealt with immediately, even if that just
means being put into a queue.
You probably want to know immediately whether the operating system is
going to permit it or not. If another program is listening to that port,
then you probably will not be able to.
Also subtypes of StreamConnectionNotifier may provide additional
information and options.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
bokiteam@ms21.hinet.net - 08 Nov 2005 18:57 GMT
haha... very clear. Thanks.
Best regards,
Boki.