protected ServerSocket m_Server = null;
protected Session m_Session = null;


protected void InitServer ()
{
	if (m_Server == null)
	{

		try
		{
			m_Server = new ServerSocket ( m_Port, 6 );
			m_Log.addItem ( "Socket server is up at port: " + m_Port );
			m_Log.makeVisible ( m_Log.countItems ()  - 1);
		} catch ( IOException e)
		{
			m_Log.addItem ( "Could not create socket:" + m_Port );
			m_Log.addItem ( e.getMessage() );
			m_Log.makeVisible ( m_Log.countItems ()  - 1);
			Stop ();
		}
	}
}



public void run	()
{
	InitServer (); 

	while (true)
	{
		try
		{
			m_Log.addItem ( "Waiting for Connect" );
			m_Session = new Session (m_Server.accept(), m_Connection, m_Log);
			m_Log.addItem ( "User has attached" );
			m_Log.makeVisible ( m_Log.countItems ()  - 1);
		} catch ( IOException e)
		{
			m_Log.addItem ( "Could not Accept" + m_Port );
			m_Log.addItem ( e.getMessage() );
			m_Log.makeVisible ( m_Log.countItems ()  - 1);
			Stop ();
		}
	}
}


