Sun Microsystems V2.0 manual Configuring projects in an IDE, Socket Proxy GUI mode

Models: V2.0

1 54
Download 54 pages 11.11 Kb
Page 42
Image 42

HTTP Proxy

If the host computer running the Socket Proxy is behind a proxy server, the device can still access the Internet if the following property is specified in the MANIFEST.MF:

com.sun.squawk.io.j2me.http.Protocol-HttpProxy: <proxyaddress>:<port>

where proxyaddress is the hostname or IP address of the HTTP proxy server and port is the proxy's TCP port.

Socket Proxy GUI mode

The SocketProxy program actually has two modes it can run in. The default as shown earlier, which presents a headless version. There is also a GUI version that allows you to view log information and see what is actually going on. To launch the proxy in GUI mode, issue the following command

ant socket-proxy-gui

This will present you with the following window:

base station's serial port the serial port that the base station is connected to. This is automatically

 

populated by the calling scripts.

Radiogram port

the radiogram port used to establish the initial connection.

 

This panel lets the user select the logging level to use. The log level

 

affects which logs are to be displayed in the log panel.

 

1.

System: log all that is related to the proxy itself

 

2.

Error: log all that is an error (exceptions)

 

3.

Warning: log all that is a warning

 

4.

Info: log all extra information (incoming connections, closing connections)

 

5.

I/O: log all I/O activities

Radio port usage

the SocketProxy reserves a radio port for every Sun SPOT connected to it.

 

This counter lets you monitor that activity. Whenever the SocketProxy

 

runs out of radio ports, it will say so in here and stop accepting new

 

connections until some ports get freed up.

The log level can be set with the socketproxy.loglevel property in the SDK's default.properties file. The log levels are the same as in the GUI mode but they are set in a complementary way. So if warning is selected as a level, the level will actually be system, error and warning.

The default radiogram port used for the initial connection can be set with the socketproxy.initport property in the SDK's default.properties file.

Configuring projects in an IDE

This section includes general-purpose notes for setting up all IDEs. We assume that the reader is familiar with his or her own IDE, and in particular, incorporating the various ant scripts that this guide refers to.

42

Page 42
Image 42
Sun Microsystems V2.0 manual Configuring projects in an IDE, Socket Proxy GUI mode