×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    25

    server socket on Nokia 6600

    I'm trying to run the sockets portion of the NetworkDemo that comes with sun's WTK2.1 on a Nokia 6600. In the series 60 emulator from Nokia, everything works perfectly.

    I modified the server portion of the application to print the IP addresses of the phone using ServerSocketConnection::getLocalAddress() (and correspondingly for the port; I'm using 5000)

    On the phone, things are not so wonderful. The IP address is 127.0.0.1 (localhost) until either some other application accesses the Internet (ie, start Opera) or my application perform an http connection (I added this ability to the Server class). Once something has accessed the Internet, getLocalAddress() actually returns what appears to be a valid IP address.

    However, nothing I do seems to be able to reach the phone. I cannot ping the phone, traceroute seems never to end, and telnet <phone's IP> 5000 (which works great when I run in the emulator) times out.

    Does anybody know why this might be?

    Thanks!

    -Jon

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    41

    may be a local IP address

    The address may only be valid within the mobile network, and is subject to NAT - so cannot be accessed from outside the network.

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    25

    NAT it is, but...

    You were right! The IP address for the phone was 10.xxx.xxx.xxx (used for internal networks), so I'm assuming it is behind NAT.

    I can successfully use the phone as a client to open a socket connection to a server, however communication only seems to be one-way. I can send from the server to the phone, but the phone doesn't send to the server. I find this very strange, esp. since I have successfully used two-way http connections with the phone.

    Any ideas?

    Thanks!

    -Jon

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    41

    are you flushing?

    There is a post regarding the need to call flush() after writing data to and os - this is applicable to later series 60 devices as I recall. I generally always call flush(), and this has not caused any side effects on other platforms (yet!).

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×