Problem while open socketConnection

Hi all,

I own a HTC P3600 pal, windows mobile, with Intent Midlet Manager Installed...I try to open a ServerSocketConnection to get message from server, but it fails.

I use MIDP 2.0 and CLDC 1.0

this is the code

ServerSocketConnection scn = (ServerSocketConnection) Connector.open("socket://:5000")

SocketConnection sc = (SocketConnection)scn.acceptAndOpen();

I get always "javax.microedition.io.ConnectionNotFoundExcpetion"...any idea?!?!?!

Thanx

[498 byte] By [lonebeara] at [2007-11-27 7:39:26]
# 1
port 5000 not opened?
suparenoa at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
yeah, it doesn't open that port
lonebeara at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

you can try

...

ServerSocketConnection scn = (ServerSocketConnection) Connector.open("socket://");

...

and using

int portOpened=scn.getLocalPort(); // to get the port number...

suparenoa at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
No, it doesn't work; the exception is the same above...Also, I can't see the printStackTrace, because I run it directly into my device...is there any method to see the stack?Thanks
lonebeara at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5

> No, it doesn't work; the exception is the same

> above...

> Also, I can't see the printStackTrace, because I run

> it directly into my device...is there any method to

> see the stack?

>

> Thanks

there is no server running on your device. you should bind your connection to a real server...

use an alert to display the error on your device

suparenoa at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6

..but I thought that is my DEVICE the server!!!!....

This is my situation:

- The device is linked to my notebook via USB

- I can ping it with the IP address 169.254.2.1

- Also, when I detach it from USB and get the Wireless LAN link, I got the same error...

I just want it to listen on that door for incoming connections...declaring ServerSocketConnection doesn't effectively open a PORT on my device?

If not, could you please explain to me the architecture?(I'm a newbie on J2ME)?

Thanks a lot

lonebeara at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7
check out these articles http://developers.sun.com/mobility/midp/articles/permissions/ http://www.manning-source.com/books/white/white_ch13.pdf
suparenoa at 2007-7-12 19:20:07 > top of Java-index,Java Mobility Forums,Java ME Technologies...