| Reply | « Previous Thread | Next Thread » |
|
Hello there,
i have a problem using OBEX in my Midlet. Device Discovery and Service Discovery work perfect, also i can send Data. BUT I also want to send Data in an open Connection like the following one. But the Problem is, the Server (My PC) only read the ByteString when i close the OutputStream (out.close) Maybe anybody can help me? OPEN Connection Code:
public int openConnection(String Type, Display d){
try {
this.display=d;
localDevice = LocalDevice.getLocalDevice();
conn = (ClientSession) Connector.open(ConnectionUrl);
header = conn.createHeaderSet();
header.setHeader(HeaderSet.COUNT, new Long(1));
header.setHeader(HeaderSet.NAME, localDevice.getBluetoothAddress());
header.setHeader(0x30, "New OBEX Connection");
header.setHeader(HeaderSet.DESCRIPTION, Type); //
response = conn.connect(header);
op = conn.put(header);
out = op.openOutputStream();
} catch (IOException ex) {
return 3;
}
return 4;
}
Send Data Code:
public void sendMyData(String Message){
try {
byte[] data = Message.getBytes();
out.write(data);
out.flush();
// out.close() <--only works when i uncomment this
} catch (IOException ex) {
display.setCurrent(new Alert("Error",ex.toString(),null,AlertType.INFO));
}
Ok when i send a message which is larger than 1kb my Server recognizes the Message without the "out.close" method. Is there a way i can send a quit Message e.g. out.write(0x40)??
Last edited by MK2008E70 : 2008-12-09 at 20:24.
|
|
any one knows to catch IMEI of mobile using J@ME
|
|
-Mahbub |
| mahbub_s60 |
| View Public Profile |
| Find all posts by mahbub_s60 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem in file exchange over Bluetooth in OBEX frame work | binary123 | Mobile Java General | 11 | 2009-11-20 09:48 |
| Problem Sending more than one OBEX image | jogissa | Bluetooth Technology | 0 | 2007-09-21 11:10 |
| About 6230 Bt Problem | eerkek | Bluetooth Technology | 17 | 2005-02-08 13:33 |
| OBEX Get() problem ????? | pankajmahto | General Symbian C++ | 2 | 2004-11-17 06:33 |
| OBEX service searcher problem | sguillem | Bluetooth Technology | 2 | 2003-04-14 14:10 |