| Reply | « Previous Thread | Next Thread » |
|
we are developing a server to commnunicate with Midlets for Games .When we use socket some phone emulators do no identify the port (7210).Its ony working in with HttpConnection .
and our server is not working for Http.Is it possible to use Datagram Connection in MIDP.Datagram Connection is specified in API |
| abhijithvr |
| View Public Profile |
| Find all posts by abhijithvr |
|
Current Nokia phones only support HTTP in MIDlets.
|
|
Thanks for reply
but when we tested with socket in 7650(Series 60 ) phones its working connection.open("socket://server:port"); |
| abhijithvr |
| View Public Profile |
| Find all posts by abhijithvr |
|
I tried to connect using datagram, but i'm getting NullPointerException. Are you able to connect using datagram?
|
|
I have tried also the socket connection on 7650.
It works... up to a certain point. The program I tested opens a bidirectionnel socket url= "socket://<host>:<port>"; c = (StreamConnection) Connector.open(url,Connector.READ_WRITE, false); and creates input and output stream. there is a button to send data to the server, and a thread to receive data from the server and display them. What happens is : the midlet receives data from the server, displays them OK, but as soon as the midlet tries to send data to the server, it looks like the socket is blocked : data are never received on the server side, and data sent by the server are no more displayed on the phone. |
|
could u plz tell me what version of java MIDP u using for Socket Connection
I would like to know if any version of nokia do have support for tcp or datagram socket support in J2ME Midp. and do Midp 1.0 has tcp or udp socket support |
|
to barrylyer :
A phone needs not provide tcp socket or udp datagram support in order to be MIDP 1.0 compliant. If you want to create a socket connection, you have to do the following : url= "socket://<host>:<port>"; c = (StreamConnection) Connector.open(url,Connector.READ_WRITE, false); On phones that support socket connections (e.g. nokia 7650) this works. If however the phone does not support socket, Connector.open(...) will just throw a "socket not supported" exception. |
|
Hi gerold thanx for your reply.
But, i still have a doubt on this. Why is it that , there are different versions of sdk or MIDP/CLDC versions in each model of phone? I mean to say that , is there any standard version of java which i can follow for different phones. Im currently using java wireless toolkit 2.0 and 1.0.4_01 from sun. If i compile my code in 2.0 which uses java MIDP 2.0 i get no problem. But the same code when compiled under 1.0.4_01 which uses java MIDP 1.0 shows compilation errors in Socket. How can choose the SDK or the exact version of MIDP which has support for sockets. And is there and version of MIDP 1.0.x which has support for Socket. |
|
The code I put in my previous message does compile with WTK under 1.0.4_01 , which I am using for developments .
The ServerSocketConnection and DatagramConnection classes are not part of MIDP1, only of MIDP2, however I did not use these classes. I wrote : c = (StreamConnection) Connector.open(url,Connector.READ_WRITE, false); where url starts with "socket://..." This compiles OK, and at runtime phones that do not implement sockets throw an exception. Hope this helps. AG |
|
Hi gerodol
Thanx a lot ya Hope im getting it right. |
|
hi i too facing the same probelm ,i have my J2SE Datagram server running on port number 17000,and the app is running on emualotr is working fine when it local address as i chnage the address to the static address it never responds to that ,
I see that meesage from clients nevers reaches the server and no error is traced at all on the client side too. So can anyone help me out on this,please. |
|
I had a problem my server not receiving data sent from the client running on the phone (But the same client was working fine with emulator). flushing data after writing to the buffer did work for me
|
|
I have the same problem, I have a datagram server application and a midlet which sends datagrams to server. In the emulator everithig is ok but when I install the midlet on my Nokia N95, no data reach to the server. The ip addres is ok, no firewalls,???
CLDC 1.1 Mido 2.1. what do you mean when you say flushing data. There is no flush method on datagram connection nor Datagram????
Last edited by fravemel : 2008-05-08 at 15:35.
|
|
You should flush() the OutputStream instance you use to send data to server.
Pit |
|
On the N95 an IAP has to be defined before your network communications are allowed to go through...
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|