iam making a j2me messenger using msn server . the server communicates the protocol8(which)iam using currently.
first i open the connection with the server using SocketConnection.
the i open the InputStream and the OutputStream in a separate thread which is a simple java class called Threader the object of this class is called in the midlet now the first string that i must send is the version command i.e VER 0 MSNP8 CVR0\r\n.
the server must reply back with the response VER 0 MSNP8 CVRO
this problem is that when i run my midlet the Threader class that runs this authentication process doesnt get called at all it seems that the object doesnt get created that i created in the actionCommand() method please help and tell me what to do if u can correct the code than u r welcome but kindly hurry.






/*
* Tester.java
*
* Created on July 10, 2006, 3:33 AM
*/

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.SocketConnection;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
*
* @author Administrator
* @version
*/
public class Tester extends MIDlet implements CommandListener{
Command start;
Form fmMain;
Display ds;
Threader th=new Threader();
public Tester()
{
ds=Display.getDisplay(this);
start=new Command("Go",Command.SCREEN,1);
fmMain=new Form("Geting Varified ");
fmMain.addCommand(start);
fmMain.setCommandListener(this);

}

public void startApp() {
ds.setCurrent(fmMain);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

public void commandAction(Command command, Displayable displayable) {
if(command==start)
{

th.start();
}
}
}
class Threader implements Runnable {

SocketConnection sc=null;
InputStream in=null;
OutputStream out=null;



public void run() {
try
{
getVarified();
}
catch(Exception e)
{
System.out.println(e);
}

}
public void start()
{
try
{
Thread thread=new Thread(this);
}
catch(Exception e)
{
System.out.println(e);
}
}

private void getVarified() throws IOException{
try
{
String url = "socket://" +"messenger.hotmail.com"+ ":" +1863;
sc = (SocketConnection) Connector.open(url);
in = sc.openInputStream();
out = sc.openOutputStream();
out.flush();
String str="VER 1 MSNP8 CVR0\r\n";
out.write((str+ "\r\n").getBytes());
out.flush();

StringBuffer sb = new StringBuffer();
int c = 0;
while (((c = in.read()) != -1) ) {
sb.append((char) c);
}
System.out.println(sb.toString());

}
catch(Exception e)
{
System.out.println(e.toString());
}


}

}