public void run() {
// Create a ConnectionFactory
final ConnectionFactory factory = new ConnectionFactory();
// Use the factory to get a connection
final ConnectionDescriptor connectionDescriptor =
factory.getConnection(_url, _connectionType, _connectionUID);
if (connectionDescriptor != null) {
// Connection succeeded
final int transportUsed =
connectionDescriptor.getTransportDescriptor()
.getTransportType();
UiApplication.getUiApplication().invokeLater(new Runnable() {
/**
* @see Runnable#run()
*/
public void run() {
Status.show("Connection succeeded using transport ID: "
+ transportUsed, 2000);
}
});
final UDPDatagramConnection udpCon =
(UDPDatagramConnection) connectionDescriptor
.getConnection();
try {
final byte[] buf = new byte[256];
// Send request