Hello,
I've implemented a J2ME client on a mobile phone that connects to a Java-based server on the PC in order to exchange information. I'd like to use your library to implement that server in Delphi, but I'm having a problem.
I'm using a TBFServer (I understand that the new WCL implementation is incomplete with regards to servers?) with a given service name and UUID, in combination with a TBFSerialEventsClient. The client makes an attempt to connect, which the BFServer detects. In the OnConnect event, I'd like to return the correct response code to the phone: OBEX_HTTP_OK (160, or $0A0), using the BFSerialEventsClient object. The present situation is that the J2ME app tries to connect but doesn't receive any response code from the server, so hangs. I want to send that code and then the phone will send the server some data, which I can receive using the BFSerialEventsClient's Read procedure. Is this the correct way to do it?
In short: what is the server code corresponding to this J2ME client code?
clientSession = (ClientSession) Connector.open(url, Connector.READ_WRITE, true);
...
HeaderSet hsConnectReply = clientSession.connect( clientSession.createHeaderSet() );
...
if (hsConnectReply.getResponseCode() == ResponseCodes.OBEX_HTTP_OK) {
...
I appreciate your time!
Craig