incubator-bluesky-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r885379 [27/28] - in /incubator/bluesky/trunk/RealClass: DTU/src/ TServer/ TServer/autom4te.cache/ TServer/intl/ TServer/po/ TServer/src/ TServer/src/.deps/
Date Mon, 30 Nov 2009 11:24:43 GMT
Added: incubator/bluesky/trunk/RealClass/TServer/src/adminserver.h
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/adminserver.h?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/adminserver.h (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/adminserver.h Mon Nov 30 11:24:38 2009
@@ -0,0 +1,230 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+// AdminServer.h: interface for the CAdminServer class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(ADMINSERVER_H)
+#define ADMINSERVER_H
+
+#define THREADCOUNT		1
+class CTCPPollThread;
+class CAsyncSocketEx;
+
+#include <list>
+#include "msgtype.h"
+#include "listencomm.h"
+#include "lissocket.h"
+#include "clientsocket.h"
+#include "multicomm.h"
+#include "jmutex.h"
+#include "error.h"
+#include <signal.h>  
+#include <arpa/inet.h>  
+#include <sys/types.h>  
+#include <sys/socket.h> 
+#include <sys/time.h>
+#include <unistd.h>  
+#include <netinet/in.h>  
+#include <netinet/ip.h>  
+#include <netinet/ip_icmp.h>  
+#include <netdb.h>  
+#include <setjmp.h> 
+#include <errno.h>
+class CLisSocket;
+
+//Client list
+typedef std::list<CRCLClient*> rclUserList;
+//teacher list
+typedef std::list<CRCLTeacher*> rclTeacherList;
+//MCU list
+typedef std::list<CRCLMCU*> rclMCUList;
+//SeMCU list
+typedef std::list<CRCLSeMCU*> rclSeMCUList;
+//room list
+typedef std::list<CRCLRoom*> rclRoomList;
+//IP list 
+typedef std::list<CRCLNodeIP*> rclIPList;
+//ID list 
+typedef std::list<DWORD> rclIDList;
+
+//node type,ID,name,IP,localIP
+typedef int(*NodeChangeNotify)(DWORD,DWORD,DWORD,char*,char*,char*);
+
+
+class CAdminServer
+{
+	friend class CLisSocket;
+	friend class CClientSocket;
+public:
+	int Init();
+	CAdminServer();
+	virtual ~CAdminServer();
+    int DataSent(DWORD);
+    BOOL IsComplete(std::string);
+    int rclSendMessage(DWORD,std::string);//send message to a ID with a string
+    int rclSendM();//send_thread send message
+    BOOL ParseRequest(CRCLMSG* pM, int event, SOCKET s, BOOL &bKeepAlive);
+    int GotConnection(SOCKET,char*,int);//user join
+    int Disconnect(SOCKET s);//delete a user
+private:
+	
+	int rclSendThreadHandle;//send_thread handle
+    NodeChangeNotify NodeInfoOut;//node information out
+    
+    JMutex umu;//user list 
+    JMutex tmu;//teacher list 
+    JMutex mmu;//MCU list 
+    JMutex smu;//seMCU list 
+    JMutex rmu;//room list 
+    JMutex imu;//IP list
+    JMutex dmu;//ID list 
+	JMutex Jtext_layoutC;
+	JMutex Jtext_layoutT;
+
+    DWORD hScan;
+    DWORD rclSysMax;// max number for system 
+    DWORD rclTeacherMax;//max teacher number
+    DWORD rclStudentMax;//max student number
+    DWORD rclGroupMax;//max group number
+
+
+
+public:
+	DWORD rclMCUChoose;//MCU choose mode
+	DWORD rclCurrentNum;
+	DWORD rclMaxNum;
+    DWORD rclAverageNum;
+    DWORD sum;
+    DWORD count;
+    BOOL bRun;
+
+public:
+	int rclGetIPSameA(char *ClientIP,char *MCUIP);
+    void rclDebugLog(char *log,char *vl="",int v2=0,int v3=0,int v4=0);
+ 
+    void rclScanSys();
+    int rclNodeChooseMCUIP(char* ip,char *pip,SOCKET s);
+    int rclGetIPSame(char *ClientIP,char *MCUIP);
+    int rclChooseMCU(DWORD cid,DWORD gid,SOCKET *ps,char *ip,DWORD *id);
+    int rclSeMCULeaveGroup(CRCLSeMCULeaveGroup *pMSG,SOCKET s);
+    void rclSeMCULeaveGroupLogout(DWORD SeMCUID,SOCKET s);
+    int rclSeMCUJoinGroup(CRCLSeMCUJoinGroup *pMSG,SOCKET s);
+    int rclSeMCULoginAndJoinGroup(DWORD SeMCUID,SOCKET s,int event);
+	int rclSeMCUGetGroupInfo(CRCLSeMCUGetGroupInfo *pMSG,SOCKET s);
+	int rclSeMCULogout(CRCLSeMCULogout *pMSG,SOCKET s);
+	int rclSeMCULogin(CRLCSeMCULogin *pMSG,SOCKET s,int event);
+	int rclTeacherGetClientList(CRCLTeacherGetClientList *pMSG,SOCKET s);
+
+    int rclTeacherSwitchMode(CRCLTeacherSwitchMode *pMSG,SOCKET s);
+	int rclTeacherCancelClientFocus(CRCLTeacherCancelClientFocus *pMSG,SOCKET s);
+	int rclTeacherAllowClientFocus(CRCLTeacherAllowClientFocus *pMSG,SOCKET s);
+	void rclResponseInfo(char *info);
+	int rclClientGetClientInfo(CRCLClientGetClientInfo *pMSG,SOCKET s);
+	int rclClientGetGroupInfo(CRCLClientGetCroupInfo *pMSG,SOCKET s);	
+	DWORD rclPopPushID(DWORD id);
+	int InitializeIDList(DWORD IDCount);
+	int rclResponseError(DWORD MSGType,SOCKET s,DWORD et);
+	int rclClientTextBroadcast(CRCLClientTextBroadcast *pMSG,SOCKET s);
+	int rclClientDestroyFocus(CRCLClientDestroyFocus *pMSG,SOCKET s);	
+	int rclClientApplyFocus(CRCLClientApplyFocus *pMSG,SOCKET s);
+	int rclTeacherTextBroadcast(CRCLTeacherTextBroadcast *pMSG,SOCKET s);
+	int rclMCULeaveGroup(CRCLMCULeaveGroup *pMSG,SOCKET s);
+	int rclSendResponse(char* pbuf,DWORD len,SOCKET* s,DWORD nums);
+	int rclMakePacket(char *pResponse,char *pRes,DWORD len);
+	int rclClientLogout(CRCLClientLogout *pMSG,SOCKET s);	
+	int rclClientLeaveGroup(CRCLClientLeaveGroup *pMSG,SOCKET s);
+	int rclClientJoinGroup(CRCLClientJoinInGroup *pMSG,SOCKET s);
+	int rclTeacherLeaveGroup(CRCLDestroyGroup *pMSG,SOCKET s);
+	int rclTeacherCreateGroup(CRCLCreateGroup *pMSG,SOCKET s);
+	int rclClientLogin(CRCLClientLogin *pMSG,SOCKET s,int event);
+	int rclMCULogout(CRCLMCULogout *pMSG,SOCKET s);
+	int rclMCULogin(CRCLMCULogin *pMSG,SOCKET s,int event);
+	int rclTeacherLogout(CRCLTeacherLogout *pMSG,SOCKET s);
+	int rclTeacherLogin(CRCLTeacherLogin *pMSG,SOCKET s,int event);	
+	int rclUserSendTextToGroup(DWORD userid,DWORD groupid,std::string text,int flag);	
+	int rclUserSendTextToUser();
+	int rclTeacherChat(CRCLTeacherChat *pMSG ,SOCKET s);
+	int rclBroadCast(DWORD);
+	void pingtest();
+		
+	void* statistics(int signo);  
+	unsigned short cal_chksum(unsigned short *addr,int len);  
+	int pack(int pack_no);  
+	void send_packet(void);  
+	void recv_packet(void);  
+	int unpack(char *buf,int len);  
+	void tv_sub(struct timeval *out,struct timeval *in); 
+	
+	void rclShowTeacherInfo();
+	void rclShowUserInfo();
+	void rclShowMCUInfo();
+	void rclShowSeMCUInfo();
+	void rclShowRoomInfo();
+	void rclShowIPInfo();
+	void rclShowIDInfo();
+	void rclShowFocusInfo();
+	
+	void rclShutdown();
+
+	
+	long rclSThreadEvent;
+
+	DWORD rclSendThreadID;
+
+	
+	rclUserList UserList;
+
+	
+	rclTeacherList TeacherList;
+
+	
+	rclMCUList MCUList;
+
+	
+	rclSeMCUList SeMCUList;
+
+	
+	rclRoomList RoomList;
+	
+	
+	rclIPList IPList;
+	rclIPList IPList2;
+	
+	
+	rclIDList IDList;
+	
+	
+	
+public:
+	DWORD ListenPort;
+	DWORD MaxOnline;
+	DWORD MaxTeacherOnline;
+	DWORD MaxStudentOnline;
+	DWORD MCUChoose;
+	DWORD ClientTalk;
+	char ReplaceText[1024];
+	CMultiComm m_accept[THREADCOUNT];
+	CListenComm m_listen;
+protected:
+private:
+
+	CLisSocket m_listemsocket;
+};
+
+#endif // !defined(ADMINSERVER_H)

Added: incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.cpp
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.cpp?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.cpp (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.cpp Mon Nov 30 11:24:38 2009
@@ -0,0 +1,286 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+// AsyncSocketEx.cpp: 
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "asyncsocketex.h"
+
+
+//////////////////////////////////////////////////////////////////////
+// construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CAsyncSocketEx::CAsyncSocketEx()
+{
+	m_SocketData.hSocket=INVALID_SOCKET;
+	m_SocketData.nSocketIndex=-1;
+	m_lEvent = 0;
+}
+
+CAsyncSocketEx::~CAsyncSocketEx()
+{
+	Close();
+}
+
+BOOL CAsyncSocketEx::Create( UINT nSocketPort /*=0*/, int nSocketType /*=SOCK_STREAM*/, LPCTSTR lpszSocketAddress /*=NULL*/ )
+{
+
+	SOCKET hSocket=socket(AF_INET, nSocketType, 0);
+	if (hSocket==INVALID_SOCKET)
+		return false;
+	m_SocketData.hSocket=hSocket;
+	int one =1;
+	if(!SetSockOpt(SO_REUSEADDR, (char *) &one, sizeof(int), SOL_SOCKET))
+		printf("error\n");
+	if (!Bind(nSocketPort, lpszSocketAddress))
+	{
+		Close();
+		return false;
+	}
+	return true;
+}
+
+BOOL CAsyncSocketEx::Bind(UINT nSocketPort, LPCTSTR lpszSocketAddress)
+{
+	SOCKADDR_IN sockAddr;
+	memset(&sockAddr,0,sizeof(sockAddr));
+
+	LPSTR lpszAscii = (LPSTR)lpszSocketAddress;
+	sockAddr.sin_family = AF_INET;
+
+	if (lpszAscii == NULL)
+		sockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
+	else
+	{
+		DWORD lResult = inet_addr(lpszAscii);
+		if (lResult == INADDR_NONE)
+		{
+			return false;
+		}
+		sockAddr.sin_addr.s_addr = lResult;
+	}
+
+	sockAddr.sin_port = htons((u_short)nSocketPort);
+
+	return Bind((SOCKADDR*)&sockAddr, sizeof(sockAddr));
+}
+
+BOOL CAsyncSocketEx::Bind(const SOCKADDR* lpSockAddr, int nSockAddrLen)
+{
+	if (!bind(m_SocketData.hSocket, lpSockAddr, nSockAddrLen))
+		return true;
+	else
+		return false;
+}
+
+void CAsyncSocketEx::Close()
+{
+	if (m_SocketData.hSocket != INVALID_SOCKET)
+	{
+		if( close(m_SocketData.hSocket) == SOCKET_ERROR){
+			printf("\nclose socket error.");
+			return;
+		}
+		m_SocketData.hSocket=INVALID_SOCKET;
+		m_lEvent = 0;
+	}
+}
+
+BOOL CAsyncSocketEx::GetSockOpt(int nOptionName, void* lpOptionValue, int* lpOptionLen, int nLevel /* = SOL_SOCKET*/)
+{
+	int status;
+	if(m_SocketData.hSocket == 0)
+		return false;
+	
+	status = getsockopt(m_SocketData.hSocket, nLevel, nOptionName, lpOptionValue, (socklen_t*)lpOptionLen );
+	if (status != 0)
+		return false;
+	
+	return true;
+}
+
+BOOL CAsyncSocketEx::SetSockOpt(int nOptionName, const void* lpOptionValue, int nOptionLen, int nLevel /* = SOL_SOCKET*/)
+{
+	int status;
+	if(m_SocketData.hSocket == 0)
+		return false;
+	
+	status = setsockopt(m_SocketData.hSocket, nLevel, nOptionName, lpOptionValue, nOptionLen );
+	if (status != 0)
+		return false;
+	
+	return true;
+}
+	
+
+int CAsyncSocketEx::Receive(void* lpBuf, int nBufLen, int nFlags /*=0*/)
+{
+	return recv(m_SocketData.hSocket, (LPSTR)lpBuf, nBufLen, nFlags);
+}
+	
+
+int CAsyncSocketEx::Send(const void* lpBuf, int nBufLen, int nFlags /*=0*/)
+{
+	return send(m_SocketData.hSocket, (LPSTR)lpBuf, nBufLen, nFlags);
+}
+
+BOOL CAsyncSocketEx::Connect(LPCTSTR lpszHostAddress, UINT nHostPort)
+{
+
+	SOCKADDR_IN sockAddr;
+	memset(&sockAddr,0,sizeof(sockAddr));
+	
+	LPSTR lpszAscii = (LPSTR)lpszHostAddress;
+	sockAddr.sin_family = AF_INET;
+	sockAddr.sin_addr.s_addr = inet_addr(lpszAscii);
+	
+	if (sockAddr.sin_addr.s_addr == INADDR_NONE)
+	{
+	
+	}
+	
+	sockAddr.sin_port = htons((u_short)nHostPort);
+	
+	return CAsyncSocketEx::Connect((SOCKADDR*)&sockAddr, sizeof(sockAddr));
+}
+
+BOOL CAsyncSocketEx::Connect( const SOCKADDR* lpSockAddr, int nSockAddrLen )
+{
+	if(m_SocketData.hSocket == INVALID_SOCKET)
+		return false;
+	return SOCKET_ERROR!=connect(m_SocketData.hSocket, lpSockAddr, nSockAddrLen);
+}
+	
+
+BOOL CAsyncSocketEx::GetPeerName( SOCKADDR* lpSockAddr, int* lpSockAddrLen )
+{
+	if ( !getpeername(m_SocketData.hSocket, lpSockAddr, (socklen_t*)lpSockAddrLen) )
+		return true;
+	else
+		return false;
+}
+
+BOOL CAsyncSocketEx::GetSockName( SOCKADDR* lpSockAddr, int* lpSockAddrLen )
+{
+	if ( !getsockname(m_SocketData.hSocket, lpSockAddr, (socklen_t*)lpSockAddrLen) )
+		return true;
+	else
+		return false;
+}
+
+BOOL CAsyncSocketEx::ShutDown( int nHow /*=sends*/ )
+{
+	if ( !shutdown(m_SocketData.hSocket, nHow) )
+		return true;
+	else
+		return false;
+}
+
+SOCKET CAsyncSocketEx::Detach( )
+{
+	SOCKET socket=m_SocketData.hSocket;
+	m_SocketData.hSocket=INVALID_SOCKET;
+	m_lEvent = 0;
+	return socket;
+}
+
+BOOL CAsyncSocketEx::Attach( SOCKET hSocket, long lEvent /* = 0 */)
+{
+	if (hSocket==INVALID_SOCKET || !hSocket)
+		return false;
+
+	m_SocketData.hSocket=hSocket;
+	m_lEvent = lEvent;
+	return true;
+}
+
+BOOL CAsyncSocketEx::Listen( int nConnectionBacklog /*=5*/ )
+{
+	if (listen(m_SocketData.hSocket, nConnectionBacklog)==0)
+		return true;
+	else
+		return false;
+}
+
+BOOL CAsyncSocketEx::Accept( CAsyncSocketEx& rConnectedSocket, SOCKADDR* lpSockAddr /*=NULL*/, int* lpSockAddrLen /*=NULL*/ )
+{
+	
+	SOCKET hTemp = accept(m_SocketData.hSocket, lpSockAddr, (socklen_t*)lpSockAddrLen);
+
+	if (hTemp == INVALID_SOCKET)
+		return false;
+	rConnectedSocket.m_SocketData.hSocket=hTemp;
+	return true;
+}
+
+BOOL CAsyncSocketEx::IOCtl( long lCommand, DWORD* lpArgument )
+{
+	if ( !ioctl(m_SocketData.hSocket, lCommand, lpArgument) )
+		return false;
+	else
+		return true;
+}
+
+int CAsyncSocketEx::GetLastError()
+{
+
+	return -1;
+}
+
+
+SOCKET CAsyncSocketEx::GetSocketHandle()
+{
+	return m_SocketData.hSocket;
+}
+
+
+
+int CAsyncSocketEx::Poll()
+{
+	fd_set fdsetread;
+	struct timeval tv;
+
+	FD_ZERO(&fdsetread);
+	FD_SET(m_SocketData.hSocket,&fdsetread);
+	tv.tv_sec = 0;
+	tv.tv_usec = 10000;
+
+	
+	if (select(FD_SETSIZE,&fdsetread,0,0,&tv) < 0){
+		m_lEvent = -1;
+		return m_lEvent;
+	}
+	m_lEvent = 0;
+
+
+	if(FD_ISSET(m_SocketData.hSocket,&fdsetread)){
+
+
+			m_lEvent = 1;
+
+
+	}
+	return m_lEvent;
+}
+
+void CAsyncSocketEx::OnEvent()
+{
+
+	return ;
+}

Added: incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.h
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.h?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.h (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/asyncsocketex.h Mon Nov 30 11:24:38 2009
@@ -0,0 +1,125 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+// AsyncSocketEx.h: 
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+//#include "adminserver.h"
+#if !defined(ASYNCSOCKETEX_H)
+#define ASYNCSOCKETEX_H
+
+
+class CMultiComm ;
+class CListenComm;
+class CAsyncSocketEx  
+{
+	friend class CMultiComm;
+	friend class CListenComm;
+public:
+	virtual int Poll();
+	SOCKET GetSocketHandle();
+	/////////////////////////////////////
+	//Functions that imitate CAsyncSocket
+
+	//Construction
+	CAsyncSocketEx(); //Constructs a CAsyncSocket object
+	virtual ~CAsyncSocketEx();
+
+	//Creates a socket
+	BOOL Create(UINT nSocketPort = 0, 
+				int nSocketType = SOCK_STREAM,
+				LPCTSTR lpszSocketAddress = NULL );
+
+	//
+	inline long GetStatus(){ return m_lEvent;};
+	inline void SetStatus(long lEvent){ m_lEvent = lEvent;};
+	//Attaches a socket handle to a CAsyncSocket object
+	BOOL Attach( SOCKET hSocket, long lEvent=0);
+	
+	//Detaches a socket handle from a CAsyncSocket object
+	SOCKET Detach( );
+
+	//Gets the error status for the last operation that failed.
+	static int GetLastError();
+
+	//Gets the address of the peer socket to which the socket is connected
+	BOOL GetPeerName( SOCKADDR* lpSockAddr, int* lpSockAddrLen );
+
+	//Gets the local name for a socket
+	BOOL GetSockName( SOCKADDR* lpSockAddr, int* lpSockAddrLen );
+
+	//Retrieves a socket option
+	BOOL GetSockOpt(int nOptionName, void* lpOptionValue, int* lpOptionLen, int nLevel = SOL_SOCKET);
+
+	//Sets a socket option
+	BOOL SetSockOpt(int nOptionName, const void* lpOptionValue, int nOptionLen, int nLevel = SOL_SOCKET);
+	
+
+	//Operations
+
+
+	virtual void Close();
+	
+	
+	BOOL Bind(UINT nSocketPort, LPCTSTR lpszSocketAddress);
+	BOOL Bind(const SOCKADDR* lpSockAddr, int nSockAddrLen);
+
+	virtual BOOL Connect(LPCTSTR lpszHostAddress, UINT nHostPort);
+	virtual BOOL Connect( const SOCKADDR* lpSockAddr, int nSockAddrLen );
+
+	BOOL Listen( int nConnectionBacklog = 5 );
+	virtual BOOL Accept( CAsyncSocketEx& rConnectedSocket, SOCKADDR* lpSockAddr = NULL, int* lpSockAddrLen = NULL );
+
+	
+	
+	BOOL IOCtl( long lCommand, DWORD* lpArgument );
+
+	
+	BOOL ShutDown( int nHow = sends );
+
+	
+	virtual int Receive(void* lpBuf, int nBufLen, int nFlags = 0);
+	virtual int Send(const void* lpBuf, int nBufLen, int nFlags = 0);
+
+	enum { receives = 0, sends = 1, both = 2 };
+
+
+protected:
+//	virtual void OnReceive(int nErrorCode){};
+//	virtual void OnSend(int nErrorCode){};
+//	virtual void OnConnect(int nErrorCode){};
+//	virtual void OnAccept(int nErrorCode){};
+//	virtual void OnClose(int nErrorCode){};
+	
+protected:
+	virtual void OnEvent();
+
+protected:	
+	struct t_AsyncSocketExData
+	{
+		SOCKET hSocket;
+		int nSocketIndex;
+	} m_SocketData;
+
+	long m_lEvent;
+
+};
+
+
+#endif // !defined(ASYNCSOCKETEX_H)

Added: incubator/bluesky/trunk/RealClass/TServer/src/callbacks.cpp
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/callbacks.cpp?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/callbacks.cpp (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/callbacks.cpp Mon Nov 30 11:24:38 2009
@@ -0,0 +1,226 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include "callbacks.hh"
+#include "interface.hh"
+#include "support.hh"
+
+#include "stdafx.h"
+#include "asyncsocketex.h"
+#include <list>
+#include <string>
+#include "clientsocket.h"
+#include "multicomm.h"
+#include "listencomm.h"
+#include "adminserver.h"
+#include <pthread.h>
+
+CAdminServer server;
+extern GtkWidget *exit1;
+extern GtkWidget *start;
+extern GtkWidget *update;
+extern GtkWidget *entry_usernum;
+extern GtkWidget *entry_maxnum;
+extern GtkWidget *entry_avenum;
+extern GtkWidget *scrolledwindow_info;
+GtkAdjustment* change;
+static gint timer = 0;
+gdouble val = 0;
+extern GtkTextBuffer *buffer;
+extern GtkTextIter start1,end;
+pthread_t ping;
+
+void
+on_start_activate                 (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+#ifdef WIN32
+	WSADATA dat;
+	WSAStartup(MAKEWORD(2,2),&dat);
+#endif // WIN32
+    gtk_widget_set_sensitive (exit1, true);
+	gtk_widget_set_sensitive (start, false);
+	gtk_widget_set_sensitive (update, true);
+	server.Init();
+
+}
+
+void*
+accept_test(void*)
+{
+	while(1)
+	{
+		server.pingtest();
+		sleep(5);
+	}
+}
+void
+on_about1_activate                     (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+
+}
+
+
+void
+on_set_activate                        (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+
+}
+
+
+void
+on_update_activate                     (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	server.rclShowTeacherInfo();
+	server.rclShowUserInfo();
+	server.rclShowMCUInfo();
+	server.rclShowSeMCUInfo();
+	server.rclShowRoomInfo();
+}
+
+
+void
+on_help_activate                       (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+
+}
+
+
+void
+on_about_activate                      (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	GtkWidget *about;
+	about = create_About();
+	gtk_widget_show_all(about);
+
+}
+
+
+void
+on_button_clear_clicked                (GtkButton       *button,
+                                        gpointer         user_data)
+{
+	gtk_text_buffer_get_start_iter(buffer,&start1);
+	gtk_text_buffer_delete(buffer,&start1,&end);
+
+}
+
+
+void
+on_button_update_clicked               (GtkButton       *button,
+                                        gpointer         user_data)
+{
+	server.rclShowTeacherInfo();
+	server.rclShowUserInfo();
+	server.rclShowMCUInfo();
+	server.rclShowSeMCUInfo();
+	server.rclShowRoomInfo();
+
+}
+
+gint timer_callback(void* para)
+{
+	if(server.count == 0)
+		server.count = 1;
+	char usernum[8],maxnum[8],avenum[8];
+	sprintf(usernum,"%d",server.rclCurrentNum);
+	gtk_entry_set_text((GtkEntry*)entry_usernum,usernum);
+	if(server.rclMaxNum < server.rclCurrentNum)
+	{
+		server.rclMaxNum = server.rclCurrentNum;
+		sprintf(maxnum,"%d",server.rclMaxNum);
+		gtk_entry_set_text((GtkEntry*)entry_maxnum,maxnum);
+	}
+	server.sum += server.rclCurrentNum;
+	server.rclAverageNum = (int)((2*server.sum+server.count) / (2*server.count));
+	printf("%d***********%d**********%d\n",server.sum,server.rclAverageNum,server.count);
+	sprintf(avenum,"%d",server.rclAverageNum);
+	gtk_entry_set_text((GtkEntry*)entry_avenum,avenum);
+
+	server.count++;
+
+	server.rclShowTeacherInfo();
+	server.rclShowUserInfo();
+	server.rclShowMCUInfo();
+	server.rclShowSeMCUInfo();
+	server.rclShowRoomInfo();
+	return 1;
+}
+
+gint quit_callback(void*)
+{
+	printf("system stop......\n");
+	pthread_detach(ping);
+	server.rclShutdown();
+	
+    return false;	
+}
+
+void
+on_scrolledwindow_move_focus_out      (GtkScrolledWindow *scrolledwindow,
+                                        GtkDirectionType  direction,
+                                        gpointer         user_data)
+{
+	printf("@@@@@@@@@@@@2\n");
+	change = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info));
+	gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info),change);
+	
+	change = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info));
+	val = change->value;
+	val += 5;
+	printf("****%d****\n",val);
+	gtk_adjustment_set_value(GTK_ADJUSTMENT(change),val);
+	gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info),change);
+}
+
+
+void
+on_scrolledwindow_scroll_child        (GtkScrolledWindow *scrolledwindow,
+                                        GtkScrollType    scroll,
+                                        gboolean         horizontal,
+                                        gpointer         user_data)
+{
+	gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info),change);
+	
+	change = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info));
+	val = change->value;
+	val += 5;
+	printf("****%d****\n",val);
+	gtk_adjustment_set_value(GTK_ADJUSTMENT(change),val);
+	gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info),change);
+}
+
+void auto_change(void)
+{
+	change = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info));
+	val = change->value;
+	val += 5;
+	printf("****%d****\n",val);
+	gtk_adjustment_set_value(GTK_ADJUSTMENT(change),val);
+	gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow_info),change);
+}

Added: incubator/bluesky/trunk/RealClass/TServer/src/callbacks.hh
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/callbacks.hh?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/callbacks.hh (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/callbacks.hh Mon Nov 30 11:24:38 2009
@@ -0,0 +1,68 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+#include <gtk/gtk.h>
+
+
+
+void
+on_about1_activate                     (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_start_activate                      (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_set_activate                        (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_update_activate                     (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_help_activate                       (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_about_activate                      (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_button_clear_clicked                (GtkButton       *button,
+                                        gpointer         user_data);
+
+void
+on_button_update_clicked               (GtkButton       *button,
+                                        gpointer         user_data);
+										
+gint timer_callback(void*);
+gint quit_callback(void*);
+
+void
+on_scrolledwindow_move_focus_out      (GtkScrolledWindow *scrolledwindow,
+                                        GtkDirectionType  direction,
+                                        gpointer         user_data);
+
+void
+on_scrolledwindow_scroll_child        (GtkScrolledWindow *scrolledwindow,
+                                        GtkScrollType    scroll,
+                                        gboolean         horizontal,
+                                        gpointer         user_data);
+										
+void auto_change(void);
+void* accept_test(void*);

Added: incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.cpp
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.cpp?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.cpp (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.cpp Mon Nov 30 11:24:38 2009
@@ -0,0 +1,97 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+// ClientSocket.cpp: implementation of the CClientSocket class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "clientsocket.h"
+#include "adminserver.h"
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+extern CAdminServer server;
+CClientSocket::CClientSocket()
+{
+
+}
+
+CClientSocket::~CClientSocket()
+{
+	Close();
+}
+
+void CClientSocket::OnEvent()
+{
+	char recvbuffer[10000];
+	char caddr[50];
+    unsigned long len;
+	SOCKADDR lpSockAddr;
+    SOCKET s;
+	int iplen = sizeof(SOCKADDR);
+	BOOL rclb;
+	rclb = false;
+	if(m_lEvent == 0)			//no any event.
+		return;
+	IOCtl(FIONREAD, &len);
+	if(len==0){			//disconnect.
+		int ret = 1;
+
+		server.Disconnect(GetSocketHandle());
+		printf("read to close socket\n");
+		ShutDown(both);
+		while(ret>0){
+			ret = Receive(recvbuffer, 10000);	
+		}
+		Close();
+		printf("A client disconnected.\n");
+		return ;
+	}
+
+	s = GetSocketHandle();
+	if(GetPeerName(&lpSockAddr,&iplen))
+	{
+	SOCKADDR_IN* ip = (SOCKADDR_IN*)&lpSockAddr;
+		sprintf(caddr,"%d.%d.%d.%d",
+		        ((u_char*)&ip->sin_addr.s_addr)[0], 
+				((u_char*)&ip->sin_addr.s_addr)[1], 
+				((u_char*)&ip->sin_addr.s_addr)[2], 
+				((u_char*)&ip->sin_addr.s_addr)[3]);
+	server.GotConnection(s, caddr, ip->sin_port);		
+	printf("%s\n",caddr);
+
+	}
+	memset(recvbuffer, 0, 10000);
+	int recv_len = Receive(recvbuffer, 9999);
+	CRCLMSG* pM = (CRCLMSG*)recvbuffer;
+	int index = recv_len;
+	int packetlen = pM->msglen +8 - recv_len;
+	while(packetlen > 0)
+	{
+		recv_len = Receive(recvbuffer+index, packetlen);
+		printf("	recv a message lenth is %d\n",recv_len);
+		index += recv_len;
+		packetlen -= recv_len;
+	}
+	pM = (CRCLMSG*)recvbuffer;
+
+
+	if(!server.ParseRequest(pM, 1, s, rclb))
+		printf("parse failed\n");
+
+	return ;
+}

Added: incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.h
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.h?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.h (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/clientsocket.h Mon Nov 30 11:24:38 2009
@@ -0,0 +1,40 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+// ClientSocket.h: interface for the CClientSocket class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(CLIENTSOCKET_H)
+#define CLIENTSOCKET_H
+
+
+#include "asyncsocketex.h"
+#include <string>
+class CClientSocket : public CAsyncSocketEx  
+{
+	//friend class CClientSocket;
+public:
+	CClientSocket();
+	virtual ~CClientSocket();
+
+protected:
+	virtual void OnEvent();
+
+};
+
+
+#endif // !defined(CLIENTSOCKET_H)

Added: incubator/bluesky/trunk/RealClass/TServer/src/error.h
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/error.h?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/error.h (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/error.h Mon Nov 30 11:24:38 2009
@@ -0,0 +1,61 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+#define RCL_PASSWORD_ERROR						1	
+#define RCL_USER_AlREADY_ONLINE					2	
+#define RCL_MAX_USER								3	
+#define RCL_LOGIN_ERROR							4	
+#define RCL_MAX_TEACHER                          5   
+#define RCL_MAX_STUDENT		                    6   
+
+
+#define RCL_TEACHER_CREATE_GROUP_NOMCU			10	
+#define RCL_TEACHER_CREATE_GROUP_FAIL			11	
+#define RCL_MAX_GROUP							12	
+#define RCL_TEACHER_LEAVE_GROUP_FAIL				13	
+
+
+#define RCL_STUDENT_JOIN_GROUP_FAIL				20	
+#define RCL_STUDENT_LEAVE_GROUP_FAIL				21	
+#define RCL_STUDENT_GROUP_MAX_USER				22	
+
+
+#define RCL_MCU_LEAVE_GROUP_FAIL					30	
+
+
+#define RCL_STUDENT_APPLY_FOCUS_NO_TOKEN			40	
+#define RCL_STUDENT_APPLY_FOCUS_FAIL				41	
+#define RCL_STUDENT_KILL_FOCUS_FAIL				42	
+#define RCL_STUDENT_BROADCAST_TEXT_FAIL			43	
+
+
+#define RCL_TEACHER_BROADCAST_TEXT_FAIL			50	
+
+
+#define RCL_STUDENT_GET_GROUPLIST_FAIL			60	
+#define RCL_STUDENT_GET_CLIENTLIST_FAIL			61	
+
+
+#define RCL_TEACHER_ALLOW_FOCUS_EXIST			70 
+#define RCL_TEACHER_ALLOW_FOCUS_FAIL				71 
+
+
+#define RCL_TEACHER_CANCEL_FOCUS_NOT_EXIST		80 
+#define RCL_TEACHER_CANCEL_FOCUS_FAIl			81 
+
+
+#define RC_UNKNOW_ERROR							10001	

Added: incubator/bluesky/trunk/RealClass/TServer/src/interface.cpp
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/interface.cpp?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/interface.cpp (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/interface.cpp Mon Nov 30 11:24:38 2009
@@ -0,0 +1,671 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+//LANG = utf8;
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <gdk/gdkkeysyms.h>
+#define GTK_ENABLE_BROKEN
+#include <gtk/gtk.h>
+
+
+#include "callbacks.hh" 
+#include "interface.hh"
+#include "support.hh"
+
+#include "languagechoose.h" //choose lanuage  2007.11.10
+
+#define CURRENT_VERSION "2.0"
+  
+
+  
+GtkWidget *exit1;
+GtkWidget *start; 
+GtkWidget *update;
+GtkWidget *textview_info;
+GtkTextBuffer *buffer;
+GtkTextIter start1,end;
+GtkWidget *clist_room;
+GtkWidget *clist_teacher;
+GtkWidget *clist_student;
+GtkWidget *clist_mcu;
+GtkWidget *clist_semcu;
+GtkWidget *entry_usernum;
+GtkWidget *entry_maxnum;
+GtkWidget *entry_avenum;
+GtkWidget *scrolledwindow_info;
+
+
+GtkWidget*
+create_window_tserver (void)
+{
+  GtkWidget *window_tserver;
+  GtkWidget *hbox1;
+  GtkWidget *vbox1;
+  GtkWidget *menubar;
+  GtkWidget *menuitem1;
+  GtkWidget *menuitem1_menu;
+  GtkWidget *separatormenuitem1;
+  
+  GtkWidget *menuitem4;
+  GtkWidget *menuitem4_menu;
+  GtkWidget *set;
+
+  GtkWidget *help;
+  GtkWidget *help_menu;
+  GtkWidget *about;
+  GtkWidget *version;
+  GtkWidget *hbox2;
+  GtkWidget *vbox4;
+
+  
+  GtkWidget *hbox6;
+  GtkWidget *button_clear;
+  GtkWidget *button_update;
+  GtkWidget *vbox2;
+  GtkWidget *vbox3;
+  GtkWidget *hbox3;
+  GtkWidget *label_usernum;
+
+  GtkWidget *hbox4;
+  GtkWidget *label_maxnum;
+
+  GtkWidget *hbox5;
+  GtkWidget *label_avenum;
+
+  GtkWidget *notebook_info;
+  GtkWidget *scrolledwindow_room;
+  
+  GtkWidget *room_id;
+  GtkWidget *room_name;
+  GtkWidget *rteacher_id;
+  GtkWidget *rmcu_id;
+  GtkWidget *rfocus_id;
+  GtkWidget *roomlist;
+  GtkWidget *scrolledwindow_teacher;
+  
+  GtkWidget *teacher_id;
+  GtkWidget *teacher_name;
+  GtkWidget *teacher_ip;
+  GtkWidget *tmcu_id;
+  GtkWidget *teacherlist;
+  GtkWidget *scrolledwindow_student;
+  
+  GtkWidget *student_id;
+  GtkWidget *student_name;
+  GtkWidget *student_ip;
+  GtkWidget *sroom_id;
+  GtkWidget *smcu_id;
+  GtkWidget *focus;
+  GtkWidget *studentlist;
+  GtkWidget *scrolledwindow_mcu;
+  
+  GtkWidget *mcu_id;
+  GtkWidget *mcu_name;
+  GtkWidget *mcu_ip;
+  GtkWidget *mroom_id;
+  GtkWidget *MCUlist;
+  GtkWidget *scrolledwindow_semcu;
+  
+  GtkWidget *semcu_id;
+  GtkWidget *semcu_name;
+  GtkWidget *semcu_ip;
+  GtkWidget *semmcu_id;
+  GtkWidget *seroom_id;
+  GtkWidget *SeMCUlist;
+  
+  GtkWidget *label_num;
+  GtkWidget *label_list;
+  GtkWidget *label_info;
+  GtkWidget *alignment_num;
+  GtkWidget *alignment_list;
+  GtkWidget *alignment_info;
+  GtkWidget *frame_num;
+  GtkWidget *frame_list;
+  GtkWidget *frame_info;
+
+  GtkWidget *vbox_num; 
+  GtkWidget *vbox_list;
+  GtkWidget *vbox_info;
+  GtkStyle *style;
+
+  window_tserver = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  style = gtk_rc_get_style( window_tserver );
+  pango_font_description_set_family(style->font_desc, "Stsong" );
+  gtk_widget_set_style( window_tserver, style );
+  gtk_window_set_modal((GtkWindow *)window_tserver,TRUE);
+  gtk_window_set_title (GTK_WINDOW (window_tserver), pwindow_title);
+  gtk_window_set_default_size (GTK_WINDOW (window_tserver), 600, 400);
+  g_signal_connect(G_OBJECT(window_tserver),"destroy",
+                   G_CALLBACK(gtk_main_quit),NULL);
+  gtk_window_set_resizable(GTK_WINDOW (window_tserver),FALSE);
+  
+  gtk_window_set_position((GtkWindow*)window_tserver,GTK_WIN_POS_CENTER_ALWAYS);
+
+  hbox1 = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (hbox1);
+  gtk_container_add (GTK_CONTAINER (window_tserver), hbox1);
+
+  vbox1 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox1);
+  gtk_box_pack_start (GTK_BOX (hbox1), vbox1, TRUE, TRUE, 0);
+
+  menubar = gtk_menu_bar_new ();
+  gtk_widget_show (menubar);
+  gtk_box_pack_start (GTK_BOX (vbox1), menubar, FALSE, FALSE, 0);
+
+  menuitem1 = gtk_menu_item_new_with_mnemonic (pmenu_system);  
+  gtk_widget_show (menuitem1);
+  gtk_container_add (GTK_CONTAINER (menubar), menuitem1);
+
+  menuitem1_menu = gtk_menu_new ();
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem1), menuitem1_menu);
+
+  start = gtk_menu_item_new_with_mnemonic (pstart_system); 
+  gtk_widget_show (start);
+  gtk_container_add (GTK_CONTAINER (menuitem1_menu), start);
+
+ 
+  separatormenuitem1 = gtk_separator_menu_item_new ();
+  gtk_widget_show (separatormenuitem1);
+  gtk_container_add (GTK_CONTAINER (menuitem1_menu), separatormenuitem1);
+  gtk_widget_set_sensitive (separatormenuitem1, FALSE);
+
+  exit1 = gtk_menu_item_new_with_mnemonic (pexit_system);  
+  gtk_widget_show (exit1);
+  gtk_container_add (GTK_CONTAINER (menuitem1_menu), exit1);
+
+
+  menuitem4 = gtk_menu_item_new_with_mnemonic (pcontrol);  
+  gtk_widget_show (menuitem4);
+  gtk_container_add (GTK_CONTAINER (menubar), menuitem4);
+
+  menuitem4_menu = gtk_menu_new ();
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menuitem4_menu);
+
+  update = gtk_menu_item_new_with_mnemonic (pupdate);  
+  gtk_widget_show (update);
+  gtk_container_add (GTK_CONTAINER (menuitem4_menu), update);
+  gtk_widget_set_sensitive (update, FALSE);
+
+  help = gtk_menu_item_new_with_mnemonic (phelp);  
+  gtk_widget_show (help);
+  gtk_container_add (GTK_CONTAINER (menubar), help);
+
+  help_menu = gtk_menu_new ();
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (help), help_menu);
+
+  about = gtk_menu_item_new_with_mnemonic (pabout); 
+  gtk_widget_show (about);
+  gtk_container_add (GTK_CONTAINER (help_menu), about);
+
+  hbox2 = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (hbox2);
+  gtk_box_pack_start (GTK_BOX (vbox1), hbox2, TRUE, TRUE, 0);
+
+  vbox4 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox4);
+  gtk_box_pack_start (GTK_BOX (hbox2), vbox4, TRUE, TRUE, 0);
+  
+  frame_info = gtk_frame_new (NULL);
+  gtk_widget_show (frame_info);
+  gtk_box_pack_start (GTK_BOX (vbox4), frame_info, TRUE, TRUE, 0);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame_info), GTK_SHADOW_ETCHED_OUT);
+
+  alignment_info = gtk_alignment_new (0.5, 0.5, 1, 1);
+  gtk_widget_show (alignment_info);
+  gtk_container_add (GTK_CONTAINER (frame_info), alignment_info);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment_info), 0, 0, 12, 0);
+  
+  vbox_info = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox_info);
+  gtk_container_add (GTK_CONTAINER (alignment_info), vbox_info);
+
+  label_info = gtk_label_new (psever_log);  
+  gtk_widget_show (label_info);
+  gtk_frame_set_label_widget (GTK_FRAME (frame_info), label_info);
+  gtk_label_set_use_markup (GTK_LABEL (label_info), TRUE);
+
+  scrolledwindow_info = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow_info);
+  gtk_box_pack_start (GTK_BOX (vbox_info), scrolledwindow_info, TRUE, TRUE, 0);
+  gtk_widget_set_size_request (scrolledwindow_info, 220, 320);
+  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow_info), GTK_SHADOW_IN);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow_info),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  g_signal_connect ((gpointer) scrolledwindow_info, "move_focus_out",
+                    G_CALLBACK (on_scrolledwindow_move_focus_out),
+                    NULL);
+  g_signal_connect ((gpointer) scrolledwindow_info, "scroll_child",
+                    G_CALLBACK (on_scrolledwindow_scroll_child),
+                    NULL);
+
+  textview_info = gtk_text_view_new ();
+  gtk_widget_show (textview_info);
+  gtk_container_add (GTK_CONTAINER (scrolledwindow_info), textview_info);
+  
+  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview_info));
+  gtk_text_buffer_get_end_iter(buffer,&end);
+
+  gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textview_info),NULL);
+  gtk_text_view_set_editable(GTK_TEXT_VIEW(textview_info),NULL);
+
+  hbox6 = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (hbox6);
+  gtk_box_pack_start (GTK_BOX (vbox4), hbox6, TRUE, TRUE, 0);
+  gtk_widget_set_size_request (hbox6, -1, 24);
+
+  button_update = gtk_button_new_with_mnemonic (pbutn_update);  
+  gtk_widget_show (button_update);
+  gtk_box_pack_end (GTK_BOX (hbox6), button_update, FALSE, FALSE, 0);
+  gtk_widget_set_size_request (button_update, 50, -1);
+  
+  button_clear = gtk_button_new_with_mnemonic (pbutn_clear);  
+  gtk_widget_show (button_clear);
+  gtk_box_pack_end (GTK_BOX (hbox6), button_clear, FALSE, FALSE, 0);
+  gtk_widget_set_size_request (button_clear, 50, -1);
+
+  vbox2 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox2);
+  gtk_box_pack_start (GTK_BOX (hbox2), vbox2, TRUE, TRUE, 0);
+
+  vbox3 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox3);
+  gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, TRUE, 0);
+  gtk_widget_set_size_request (vbox3, 380, 100);
+  
+  frame_num = gtk_frame_new (NULL);
+  gtk_widget_show (frame_num);
+  gtk_box_pack_start (GTK_BOX (vbox3), frame_num, TRUE, TRUE, 0);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame_num), GTK_SHADOW_ETCHED_OUT);
+
+  alignment_num = gtk_alignment_new (0.5, 0.5, 1, 1);
+  gtk_widget_show (alignment_num);
+  gtk_container_add (GTK_CONTAINER (frame_num), alignment_num);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment_num), 0, 0, 12, 0);
+  
+  vbox_num = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox_num);
+  gtk_container_add (GTK_CONTAINER (alignment_num), vbox_num);
+
+  label_num = gtk_label_new (puser_statis);  
+  gtk_widget_show (label_num);
+  gtk_frame_set_label_widget (GTK_FRAME (frame_num), label_num);
+  gtk_label_set_use_markup (GTK_LABEL (label_num), TRUE);
+
+  hbox3 = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (hbox3);
+  gtk_box_pack_start (GTK_BOX (vbox_num), hbox3, TRUE, TRUE, 0);
+
+  label_usernum = gtk_label_new (pusernum);  
+  gtk_widget_show (label_usernum);
+  gtk_box_pack_start (GTK_BOX (hbox3), label_usernum, FALSE, FALSE, 0);
+  gtk_widget_set_size_request (label_usernum, 100, -1);
+
+  entry_usernum = gtk_entry_new ();
+  gtk_entry_set_text((GtkEntry*)entry_usernum,"0");
+  gtk_entry_set_editable((GtkEntry*)entry_usernum, FALSE);
+  gtk_widget_show (entry_usernum);
+  gtk_box_pack_start (GTK_BOX (hbox3), entry_usernum, FALSE, TRUE, 0);
+  gtk_widget_set_size_request (entry_usernum, 75, -1);
+
+  hbox4 = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (hbox4);
+  gtk_box_pack_start (GTK_BOX (vbox_num), hbox4, TRUE, TRUE, 0);
+
+  label_maxnum = gtk_label_new (puser_maxnum); 
+  gtk_widget_show (label_maxnum);
+  gtk_box_pack_start (GTK_BOX (hbox4), label_maxnum, FALSE, FALSE, 0);
+  gtk_widget_set_size_request (label_maxnum, 100, -1);
+
+  entry_maxnum = gtk_entry_new ();
+  gtk_entry_set_text((GtkEntry*)entry_maxnum,"0");
+  gtk_entry_set_editable((GtkEntry*)entry_maxnum, FALSE);
+  gtk_widget_show (entry_maxnum);
+  gtk_box_pack_start (GTK_BOX (hbox4), entry_maxnum, FALSE, TRUE, 0);
+  gtk_widget_set_size_request (entry_maxnum, 75, -1);
+
+  hbox5 = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (hbox5);
+  gtk_box_pack_start (GTK_BOX (vbox_num), hbox5, TRUE, TRUE, 0);
+
+  label_avenum = gtk_label_new (pavenum);
+  gtk_widget_show (label_avenum);
+  gtk_box_pack_start (GTK_BOX (hbox5), label_avenum, FALSE, FALSE, 0);
+  gtk_widget_set_size_request (label_avenum, 100, -1);
+
+  entry_avenum = gtk_entry_new ();
+  gtk_entry_set_text((GtkEntry*)entry_avenum,"0");
+  gtk_entry_set_editable((GtkEntry*)entry_avenum, FALSE);
+  gtk_widget_show (entry_avenum);
+  gtk_box_pack_start (GTK_BOX (hbox5), entry_avenum, FALSE, TRUE, 0);
+  gtk_widget_set_size_request (entry_avenum, 75, -1);
+
+  frame_list = gtk_frame_new (NULL);
+  gtk_widget_show (frame_list);
+  gtk_box_pack_start (GTK_BOX (vbox2), frame_list, TRUE, TRUE, 0);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame_list), GTK_SHADOW_ETCHED_OUT);
+
+  alignment_list = gtk_alignment_new (0.5, 0.5, 1, 1);
+  gtk_widget_show (alignment_list);
+  gtk_container_add (GTK_CONTAINER (frame_list), alignment_list);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment_list), 0, 0, 12, 0);
+  
+  vbox_list = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox_list);
+  gtk_container_add (GTK_CONTAINER (alignment_list), vbox_list);
+
+  label_list = gtk_label_new (pserv_stat);  
+  gtk_widget_show (label_list);
+  gtk_frame_set_label_widget (GTK_FRAME (frame_list), label_list);
+  gtk_label_set_use_markup (GTK_LABEL (label_list), TRUE);
+  
+  notebook_info = gtk_notebook_new ();
+  gtk_widget_show (notebook_info);
+  gtk_box_pack_start (GTK_BOX (vbox_list), notebook_info, TRUE, TRUE, 0);
+
+  scrolledwindow_room = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow_room);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow_room),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_container_add (GTK_CONTAINER (notebook_info), scrolledwindow_room);
+
+  clist_room = gtk_clist_new (5);
+  gtk_widget_show (clist_room);
+  gtk_container_add (GTK_CONTAINER (scrolledwindow_room), clist_room);
+  gtk_clist_set_column_width (GTK_CLIST (clist_room), 0, 50);
+  gtk_clist_set_column_width (GTK_CLIST (clist_room), 1, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_room), 2, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_room), 3, 80);
+  gtk_clist_set_column_width (GTK_CLIST (clist_room), 4, 80);
+  gtk_clist_column_titles_show (GTK_CLIST (clist_room));
+
+  room_id = gtk_label_new (pclassID); 
+  gtk_widget_show (room_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_room), 0, room_id);
+
+  room_name = gtk_label_new (pclassName);  
+  gtk_widget_show (room_name);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_room), 1, room_name);
+
+  rteacher_id = gtk_label_new (pteacherID);   
+  gtk_widget_show (rteacher_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_room), 2, rteacher_id);
+
+  rmcu_id = gtk_label_new (prmcu_id);  
+  gtk_widget_show (rmcu_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_room), 3, rmcu_id);
+
+  rfocus_id = gtk_label_new (pfocus_stuID); 
+  gtk_widget_show (rfocus_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_room), 4, rfocus_id);
+
+  roomlist = gtk_label_new (pclass);  
+  gtk_widget_show (roomlist);
+  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_info), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_info), 0), roomlist);
+
+  scrolledwindow_teacher = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow_teacher);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow_teacher),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_container_add (GTK_CONTAINER (notebook_info), scrolledwindow_teacher);
+
+  clist_teacher = gtk_clist_new (4);
+  gtk_widget_show (clist_teacher);
+  gtk_container_add (GTK_CONTAINER (scrolledwindow_teacher), clist_teacher);
+  gtk_clist_set_column_width (GTK_CLIST (clist_teacher), 0, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_teacher), 1, 100);
+  gtk_clist_set_column_width (GTK_CLIST (clist_teacher), 2, 120);
+  gtk_clist_set_column_width (GTK_CLIST (clist_teacher), 3, 60);
+  gtk_clist_column_titles_show (GTK_CLIST (clist_teacher));
+
+  teacher_id = gtk_label_new (pteacherID);
+  gtk_widget_show (teacher_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_teacher), 0, teacher_id);
+
+  teacher_name = gtk_label_new (pteacherName);  
+  gtk_widget_show (teacher_name);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_teacher), 1, teacher_name);
+
+  teacher_ip = gtk_label_new (pteacherIP);  
+  gtk_widget_show (teacher_ip);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_teacher), 2, teacher_ip);
+
+  tmcu_id = gtk_label_new (pclassID);  
+  gtk_widget_show (tmcu_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_teacher), 3, tmcu_id);
+
+  teacherlist = gtk_label_new (pteacher);  
+  gtk_widget_show (teacherlist);
+  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_info), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_info), 1), teacherlist);
+
+  scrolledwindow_student = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow_student);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow_student),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_container_add (GTK_CONTAINER (notebook_info), scrolledwindow_student);
+
+  clist_student = gtk_clist_new (5);
+  gtk_widget_show (clist_student);
+  gtk_container_add (GTK_CONTAINER (scrolledwindow_student), clist_student);
+  gtk_clist_set_column_width (GTK_CLIST (clist_student), 0, 50);
+  gtk_clist_set_column_width (GTK_CLIST (clist_student), 1, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_student), 2, 100);
+  gtk_clist_set_column_width (GTK_CLIST (clist_student), 3, 50);
+  gtk_clist_set_column_width (GTK_CLIST (clist_student), 4, 70);
+  gtk_clist_column_titles_show (GTK_CLIST (clist_student));
+
+  student_id = gtk_label_new (pstuID); 
+  gtk_widget_show (student_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_student), 0, student_id);
+  gtk_widget_set_size_request (student_id, 12, -1);
+
+  student_name = gtk_label_new (pstuName); 
+  gtk_widget_show (student_name);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_student), 1, student_name);
+
+  student_ip = gtk_label_new (pstuIP);  
+  gtk_widget_show (student_ip);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_student), 2, student_ip);
+
+  sroom_id = gtk_label_new (pclassID);  
+  gtk_widget_show (sroom_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_student), 3, sroom_id);
+
+  smcu_id = gtk_label_new (prmcu_id); 
+  gtk_widget_show (smcu_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_student), 4, smcu_id);
+
+ 
+
+  studentlist = gtk_label_new (pstu);  
+  gtk_widget_show (studentlist);
+  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_info), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_info), 2), studentlist);
+
+  scrolledwindow_mcu = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow_mcu);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow_mcu),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_container_add (GTK_CONTAINER (notebook_info), scrolledwindow_mcu);
+
+  clist_mcu = gtk_clist_new (4);
+  gtk_widget_show (clist_mcu);
+  gtk_container_add (GTK_CONTAINER (scrolledwindow_mcu), clist_mcu);
+  gtk_clist_set_column_width (GTK_CLIST (clist_mcu), 0, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_mcu), 1, 100);
+  gtk_clist_set_column_width (GTK_CLIST (clist_mcu), 2, 120);
+  gtk_clist_set_column_width (GTK_CLIST (clist_mcu), 3, 60);
+  gtk_clist_column_titles_show (GTK_CLIST (clist_mcu));
+
+  mcu_id = gtk_label_new (prmcu_id);  
+  gtk_widget_show (mcu_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_mcu), 0, mcu_id);
+
+  mcu_name = gtk_label_new (prmcu_name);  
+  gtk_widget_show (mcu_name);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_mcu), 1, mcu_name);
+
+  mcu_ip = gtk_label_new (prmcuIP); 
+  gtk_widget_show (mcu_ip);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_mcu), 2, mcu_ip);
+
+  mroom_id = gtk_label_new (pclassID);  
+  gtk_widget_show (mroom_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_mcu), 3, mroom_id);
+
+  MCUlist = gtk_label_new (prmcu);  
+  gtk_widget_show (MCUlist);
+  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_info), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_info), 3), MCUlist);
+
+  scrolledwindow_semcu = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow_semcu);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow_semcu),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_container_add (GTK_CONTAINER (notebook_info), scrolledwindow_semcu);
+
+  clist_semcu = gtk_clist_new (5);
+  gtk_widget_show (clist_semcu);
+  gtk_container_add (GTK_CONTAINER (scrolledwindow_semcu), clist_semcu);
+  gtk_clist_set_column_width (GTK_CLIST (clist_semcu), 0, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_semcu), 1, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_semcu), 2, 100);
+  gtk_clist_set_column_width (GTK_CLIST (clist_semcu), 3, 60);
+  gtk_clist_set_column_width (GTK_CLIST (clist_semcu), 4, 50);
+  gtk_clist_column_titles_show (GTK_CLIST (clist_semcu));
+
+  semcu_id = gtk_label_new (psemcu_id);   
+  gtk_widget_show (semcu_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_semcu), 0, semcu_id);
+
+  semcu_name = gtk_label_new (psemcu_name);  
+  gtk_widget_show (semcu_name);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_semcu), 1, semcu_name);
+
+  semcu_ip = gtk_label_new (psemcu_ip);  
+  gtk_widget_show (semcu_ip);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_semcu), 2, semcu_ip);
+
+  semmcu_id = gtk_label_new (prmcu_id); 
+  gtk_widget_show (semmcu_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_semcu), 3, semmcu_id);
+
+  seroom_id = gtk_label_new (pclassID);  
+  gtk_widget_show (seroom_id);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_semcu), 4, seroom_id);
+
+  SeMCUlist = gtk_label_new (psemcu);  
+  gtk_widget_show (SeMCUlist);
+  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_info), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_info), 4), SeMCUlist);
+
+  g_signal_connect ((gpointer) start, "activate",
+                    G_CALLBACK (on_start_activate),
+                    NULL);
+  
+  g_signal_connect ((gpointer) exit1, "activate",
+                    G_CALLBACK (gtk_main_quit),
+                    NULL);
+ 
+  g_signal_connect ((gpointer) update, "activate",
+                    G_CALLBACK (on_update_activate),
+                    NULL);
+  g_signal_connect ((gpointer) help, "activate",
+                    G_CALLBACK (on_help_activate),
+                    NULL);
+  g_signal_connect ((gpointer) about, "activate",
+                    G_CALLBACK (on_about_activate),
+                    NULL);
+
+
+
+  g_signal_connect ((gpointer) button_clear, "clicked",
+                    G_CALLBACK (on_button_clear_clicked),
+                    NULL);
+  g_signal_connect ((gpointer) button_update, "clicked",
+                    G_CALLBACK (on_button_update_clicked),
+                    NULL);
+
+  
+  return window_tserver;
+}
+
+GtkWidget * create_About( void )
+{
+  GtkWidget     * About;
+  GtkWidget     * vbox;
+  GtkWidget     * vbox1;
+  GtkWidget     * vbox2;
+  GtkWidget     * hbox1;	
+
+  GtkWidget     * AboutBufferText;
+  GtkWidget     * Ok;
+  GtkStyle *style;
+  char convert[1000];
+  GError * error;
+  char text[1000];
+
+
+  About=gtk_window_new( GTK_WINDOW_TOPLEVEL );
+  style = gtk_rc_get_style( About );
+  pango_font_description_set_family(style->font_desc, "Stsong" );
+  gtk_widget_set_style( About, style );
+  
+  gtk_widget_set_usize( About,300,200 );
+  gtk_window_set_title( GTK_WINDOW( About ),pabout);  //"" );
+  gtk_window_set_position( GTK_WINDOW( About ),GTK_WIN_POS_CENTER );
+  gtk_window_set_policy( GTK_WINDOW( About ),TRUE,FALSE,FALSE );
+  gtk_widget_realize( About );
+  gtk_window_set_modal((GtkWindow *)About,TRUE);
+
+  vbox=gtk_vbox_new(FALSE, 0);
+  gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
+  gtk_container_add(GTK_CONTAINER(About), vbox);
+
+  vbox2=gtk_vbox_new(FALSE, 0);
+
+  gtk_container_add(GTK_CONTAINER(vbox), vbox2);
+  
+  strcpy(text,pok);  
+  strcpy(convert, g_convert(text,sizeof(text),"UTF-8","ISO-8859-1",NULL, NULL, &error));
+  
+
+  
+  GtkTextBuffer *Buffer;
+  AboutBufferText = gtk_text_view_new ();
+  gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(AboutBufferText),NULL);
+  gtk_text_view_set_editable(GTK_TEXT_VIEW(AboutBufferText),NULL);
+  gtk_container_add (GTK_CONTAINER ( vbox2 ), AboutBufferText);
+  Buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW( AboutBufferText ));
+  GtkTextIter it1;
+  gtk_text_buffer_get_start_iter(Buffer, &it1);
+  gtk_text_buffer_insert(Buffer, &it1,pversion, -1);  
+  gtk_text_buffer_insert(Buffer, &it1,CURRENT_VERSION, -1);
+  
+  vbox2 = gtk_hbox_new(FALSE, 0);
+  gtk_box_pack_end(GTK_BOX(vbox), vbox2, FALSE, TRUE, 0);
+  gtk_widget_show(hbox1);
+
+
+  Ok = gtk_button_new_with_label("OK");
+  gtk_box_pack_end(GTK_BOX(vbox2), Ok, FALSE, TRUE, 0);
+
+  gtk_signal_connect_object(GTK_OBJECT( Ok ), "clicked",
+                            GTK_SIGNAL_FUNC(gtk_widget_destroy),
+                            (gpointer) About);
+
+  return About;
+}

Added: incubator/bluesky/trunk/RealClass/TServer/src/interface.hh
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/interface.hh?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/interface.hh (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/interface.hh Mon Nov 30 11:24:38 2009
@@ -0,0 +1,18 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+GtkWidget* create_window_tserver (void);
+GtkWidget * create_About( void );

Added: incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.cpp
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.cpp?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.cpp (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.cpp Mon Nov 30 11:24:38 2009
@@ -0,0 +1,663 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+
+#include "languagechoose.h"
+
+
+
+//window_title
+#ifdef LANGUAGE_EN  
+ char *pwindow_title = "Server"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pwindow_title = "课堂服务中心";
+#endif
+
+ 
+//pmenu system
+#ifdef LANGUAGE_EN  
+ char *pmenu_system = "System"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pmenu_system = "系统";
+#endif 
+
+ 
+//pstart system
+#ifdef LANGUAGE_EN  
+ char *pstart_system = "Start"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstart_system = "启动";
+#endif 
+ 
+//exit system
+#ifdef LANGUAGE_EN  
+ char *pexit_system = "Quit"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pexit_system = "退出";
+#endif 
+ 
+//pcontrol
+#ifdef LANGUAGE_EN  
+ char *pcontrol = "Control"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pcontrol = "控制";
+#endif 
+ 
+//update
+#ifdef LANGUAGE_EN  
+ char *pupdate = "Update"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pupdate = "更新";
+#endif 
+ 
+//help
+#ifdef LANGUAGE_EN  
+ char *phelp = "Help"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *phelp = "帮助";
+#endif 
+ 
+//about
+#ifdef LANGUAGE_EN  
+ char *pabout = "About"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pabout = "关于";
+#endif 
+ 
+//server log
+#ifdef LANGUAGE_EN  
+ char *psever_log = "<b>Server Log</b>"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *psever_log = "<b>服务器日志</b>";
+#endif 
+ 
+//update button
+#ifdef LANGUAGE_EN  
+ char *pbutn_update = "Update"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pbutn_update = "更新";
+#endif 
+  
+//clear-button
+#ifdef LANGUAGE_EN  
+ char *pbutn_clear = "Clear"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pbutn_clear = "清空";
+#endif 
+  
+//user statistics
+#ifdef LANGUAGE_EN  
+ char *puser_statis = "Users Statistics"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *puser_statis = "<b>服务器用户统计</b>";
+#endif 
+  
+//current user number
+#ifdef LANGUAGE_EN  
+ char *pusernum = "Current Users  "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pusernum = "当前用户数目";
+#endif 
+  
+//maximum number
+#ifdef LANGUAGE_EN  
+ char *puser_maxnum = "Maximum Number "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *puser_maxnum = "最大用户数目";
+#endif 
+  
+//average number
+#ifdef LANGUAGE_EN  
+ char *pavenum = "Average Number "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pavenum = "平均用户数目";
+#endif 
+  
+//server online status
+#ifdef LANGUAGE_EN  
+ char *pserv_stat = "<b>Server Online Status</b>"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pserv_stat = "<b>服务器在线状况</b>";
+#endif 
+  
+//class ID
+#ifdef LANGUAGE_EN  
+ char *pclassID = "ClassID"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pclassID = "课堂ID";
+#endif 
+  
+//class name
+#ifdef LANGUAGE_EN  
+ char *pclassName = "ClassName"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pclassName = "课堂名称";
+#endif 
+  
+//teacher ID
+#ifdef LANGUAGE_EN  
+ char *pteacherID = "TeacherID"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacherID = "教师ID";
+#endif 
+  
+//rmcu_id
+#ifdef LANGUAGE_EN  
+ char *prmcu_id = "Main-MCU ID"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcu_id = "主MCU ID";
+#endif 
+  
+//	Focus studentID
+#ifdef LANGUAGE_EN  
+ char *pfocus_stuID = "Focus StudentID"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pfocus_stuID = "焦点学生ID";
+#endif 
+  
+//class
+#ifdef LANGUAGE_EN  
+ char *pclass = "Class"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pclass = "课堂";
+#endif 
+  
+//teacher name
+#ifdef LANGUAGE_EN  
+ char *pteacherName = "TeacherName"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacherName = "教师名称";
+#endif 
+  
+//teacherIP
+#ifdef LANGUAGE_EN  
+ char *pteacherIP = "TeacherIP"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacherIP = "教师IP";
+#endif 
+  
+//teacher
+#ifdef LANGUAGE_EN  
+ char *pteacher = "Teacher"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher = "教师";
+#endif 
+  
+//studentID
+#ifdef LANGUAGE_EN  
+ char *pstuID = "StudentID"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstuID = "学生ID";
+#endif 
+  
+//studen name
+#ifdef LANGUAGE_EN  
+ char *pstuName = "StudentName"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstuName = "学生名字";
+#endif 
+  
+//studentIP
+#ifdef LANGUAGE_EN  
+ char *pstuIP = "StudentIP"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstuIP = "学生IP";
+#endif 
+  
+//student
+#ifdef LANGUAGE_EN  
+ char *pstu = "Student"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu = "学生";
+#endif 
+  
+//rmcu_name
+#ifdef LANGUAGE_EN  
+ char *prmcu_name = "Main-MCU Name"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcu_name = "主MCU名称";
+#endif 
+  
+//rmcuIP
+#ifdef LANGUAGE_EN  
+ char *prmcuIP = "Main-MCU IP"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcuIP = "主MCU IP";
+#endif 
+  
+//rmcu
+#ifdef LANGUAGE_EN  
+ char *prmcu = "Main-MCU"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcu = "主MCU";
+#endif 
+  
+//semcu_id
+#ifdef LANGUAGE_EN  
+ char *psemcu_id = "Sed-MCU ID"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *psemcu_id = "辅MCU ID";
+#endif 
+  
+//semcu name
+#ifdef LANGUAGE_EN  
+ char *psemcu_name = "Sed-MCU Name"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *psemcu_name = "辅MCU名称";
+#endif 
+  
+//semcu_ip
+#ifdef LANGUAGE_EN  
+ char *psemcu_ip = "Sed-MCU IP"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *psemcu_ip = "辅MCU IP";
+#endif 
+  
+//semcu
+#ifdef LANGUAGE_EN  
+ char *psemcu = "Sed-MCU"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *psemcu = "辅MCU";
+#endif 
+  
+//ok
+#ifdef LANGUAGE_EN  
+ char *pok = "OK"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pok = "确定";
+#endif 
+  
+//version
+#ifdef LANGUAGE_EN  
+ char *pversion = "The Current Version is  1.0   "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pversion = "当前的版本号为     ";
+#endif 
+  
+//Initialization
+#ifdef LANGUAGE_EN  
+ char *pInit = "Initializing......\n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pInit = "初始化......\n";
+#endif 
+  
+//Started
+#ifdef LANGUAGE_EN  
+ char *pstarted = "System launched successfully!\n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstarted = "系统启动成功!\n";
+#endif 
+  
+//student send text message
+#ifdef LANGUAGE_EN  
+ char *pstu_sed_text = "Student %s sends text message. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_sed_text = "学生%s发送文本。";
+#endif 
+  
+//teacher login
+#ifdef LANGUAGE_EN  
+ char *pteacher_login = "Teacher %s lands system. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher_login = "教师%s登陆系统。";
+#endif 
+  
+//login error
+#ifdef LANGUAGE_EN  
+ char *perror001 = "Errors: Duplicate landing. \n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror001 = "错误:重复登陆。\n";
+#endif 
+  
+//error002
+#ifdef LANGUAGE_EN  
+ char *perror002 = "Error: The same username has sexist. \n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror002 = "错误:已有同名用户存在。\n";
+#endif 
+  
+//teacher logout
+#ifdef LANGUAGE_EN  
+ char *pteacher_logout = "Techer %s exits system. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher_logout = "教师%s退出系统。";
+#endif 
+  
+//rmcu login
+#ifdef LANGUAGE_EN  
+ char *prmcu_login = "Main-MCU lands system"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcu_login = "主MCU %s登陆系统。";
+#endif 
+  
+//error003
+#ifdef LANGUAGE_EN  
+ char *perror003 = "Error: MCU repeats landing\n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror003 = "错误:MCU重复登陆\n";
+#endif 
+  
+//error004
+#ifdef LANGUAGE_EN  
+ char *perror004 = "Error: There is the same name MCU exist"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror004 = "错误:已有同名MCU存在\n";
+#endif 
+  
+//rmcu logout
+#ifdef LANGUAGE_EN  
+ char *prmcu_logout = "Main-MCU %s exits system. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcu_logout = "主MCU %s退出系统。";
+#endif 
+  
+//student login
+#ifdef LANGUAGE_EN  
+ char *pstu_login = "Student %s logins system. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_login = "学生%s登陆系统。";
+#endif 
+  
+//error005
+#ifdef LANGUAGE_EN  
+ char *perror005 = "Error: There is the same name student exist. \n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror005 = "错误:学生重复登陆。\n";
+#endif 
+  
+//error006
+#ifdef LANGUAGE_EN  
+ char *perror006 = "Error: There is the same username exist. \n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror006 = "错误:已有同名用户存在。\n";
+#endif 
+  
+//student logout
+#ifdef LANGUAGE_EN  
+ char *pstu_logout = "Student %s exits system"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_logout = "学生%s退出系统。";
+#endif 
+  
+//teacher creat class
+#ifdef LANGUAGE_EN  
+ char *ptcher_crclass = "Teacher %s creats class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *ptcher_crclass = "教师%s创建课堂%s。";
+#endif 
+  
+//teacher cancel class
+#ifdef LANGUAGE_EN  
+ char *ptcher_canlclass = "Teacher %s cancels class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *ptcher_canlclass = "教师%s撤销课堂%s。";
+#endif 
+  
+//student join in class
+#ifdef LANGUAGE_EN  
+ char *pstu_join = "Student %s joins in class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_join = "学生%s加入课堂%s。";
+#endif 
+  
+//student leave classroom
+#ifdef LANGUAGE_EN  
+ char *pstu_out = "Student %s exits class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_out = "学生%s离开课堂%s。";
+#endif 
+  
+//rmcu leave classroom
+#ifdef LANGUAGE_EN  
+ char *prmcu_exit_class = "Main-MCU %s exit class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *prmcu_exit_class = "主MCU %s退出课堂%s。";
+#endif 
+  
+//teacher send message to group 
+#ifdef LANGUAGE_EN  
+ char *pteacher_send_groupmage = "Teaher %s send text-message to group. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher_send_groupmage = "教师%s向组内用户发送文本。";
+#endif 
+  
+//change to communication
+#ifdef LANGUAGE_EN  
+ char *pclass_commu = "Class %s swich to communication mode. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pclass_commu = "课堂%s切换到交互模式。";
+#endif 
+  
+//change to teaching
+#ifdef LANGUAGE_EN  
+ char *pclass_teach = "Class %s swich to teaching mode. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pclass_teach = "课堂%s切换到授课模式。";
+#endif 
+  
+//student appli
+#ifdef LANGUAGE_EN  
+ char *pstu_appli = "Student %s applicates to be focus. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_appli = "学生%s申请焦点。";
+#endif 
+  
+//student appli cancel
+#ifdef LANGUAGE_EN  
+ char *pstu_appli_cancel = "Student %s applicates to cancel his/her focus. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_appli_cancel = "学生%s请求撤销焦点。";
+#endif 
+  
+  
+//student send group message
+#ifdef LANGUAGE_EN  
+ char *pstu_send_groupmage = "Student %s sends text-message to group. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_send_groupmage = "学生%s在组内进行文本广播。";
+#endif 
+  
+  
+//student get class information
+#ifdef LANGUAGE_EN  
+ char *pstu_get_classinfo = "Student %s gets information of class. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_get_classinfo = "学生%s获取课堂信息。";
+#endif 
+  
+  
+//student get others information
+#ifdef LANGUAGE_EN  
+ char *pstu_get_stulist = "Student %s gets information of other students in the class. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pstu_get_stulist = "学生%s获取课堂内其他学生信息。";
+#endif 
+  
+  
+//teacher option rstudent
+#ifdef LANGUAGE_EN  
+ char *pteacher_option_rstu = "Teacher %s designats student %s as focus. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher_option_rstu = "教师%s指定学生%s为焦点。";
+#endif 
+  
+  
+//teacher cancel rstudent
+#ifdef LANGUAGE_EN  
+ char *pteacher_cancel_rstu = "Teacher %s cancels the foucs of student. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher_cancel_rstu = "教师%s撤销焦点。";
+#endif 
+  
+  
+//teacher get student list
+#ifdef LANGUAGE_EN  
+ char *pteacher_get_stulist = "Teacher %s gets the student-list of the group. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pteacher_get_stulist = "教师%s获取组内学生列表。";
+#endif 
+  
+  
+//assmcu login
+#ifdef LANGUAGE_EN  
+ char *pamcu_login = "Second layer MCU %s enter system. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pamcu_login = "辅MCU %s登陆系统。";
+#endif 
+  
+  
+//assmcu login failure
+#ifdef LANGUAGE_EN  
+ char *perror007 = "Error: Second layer MCU is landing repeatly. \n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror007 = "错误:辅MCU重复登陆。\n";
+#endif 
+  
+  
+//error008
+#ifdef LANGUAGE_EN  
+ char *perror008 = "Error: There is the same name second layer MCU existing. \n"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *perror008 = "错误:已有同名辅MCU存在。\n";
+#endif 
+  
+  
+//assmcu logout
+#ifdef LANGUAGE_EN  
+ char *pamcu_logout = "Second layer %s exits from system. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pamcu_logout = "辅MCU %s退出系统。";
+#endif 
+  
+  
+//assmcu get class information
+#ifdef LANGUAGE_EN  
+ char *pamcu_get_classinfo = "Second layer MCU %s gets information of the class. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pamcu_get_classinfo = "辅MCU %s获取课堂信息。";
+#endif 
+  
+  
+//assmcu join class
+#ifdef LANGUAGE_EN  
+ char *pamcu_join = "Second layer MCU %s joins in class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pamcu_join = "辅MCU %s加入课堂%s。";
+#endif 
+  
+  
+//assmcu exit class
+#ifdef LANGUAGE_EN  
+ char *pamcu_exit = "Second layer MCU %s exits from class %s. "; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pamcu_exit = "辅MCU %s退出课堂%s。";
+#endif 
+  
+  
+//allow chat
+#ifdef LANGUAGE_EN  
+ char *pallow_chat = "Swich to the mode that allows students chating"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pallow_chat = "切换到允许学生聊天模式";
+#endif 
+  
+  
+//forbid chat
+#ifdef LANGUAGE_EN  
+ char *pforbid_chat = "Swich to the mode that forbids students chating"; 
+#endif
+#ifdef LANGUAGE_CH
+ char *pforbid_chat = "切换到禁止学生聊天模式";
+#endif 
+ 

Added: incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.h
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.h?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.h (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/languagechoose.h Mon Nov 30 11:24:38 2009
@@ -0,0 +1,414 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+#ifndef _SOURCE_NAME_H_
+#define _SOURCE_NAME_H_
+ 
+#define LANGUAGE_EN  //choose language
+
+
+// window titile
+ extern char *pwindow_title ; 
+/////////////////////
+
+
+// menu system
+ extern char *pmenu_system ; 
+/////////////////////
+
+
+// start system
+ extern char *pstart_system ; 
+/////////////////////
+
+
+// 
+ extern char *pexit_system ; 
+/////////////////////
+
+
+// control
+ extern char *pcontrol ; 
+/////////////////////
+
+
+// update
+ extern char *pupdate ; 
+/////////////////////
+
+
+// help
+ extern char *phelp ; 
+/////////////////////
+
+
+// about
+ extern char *pabout ; 
+/////////////////////
+
+
+// sever log
+ extern char *psever_log ; 
+/////////////////////
+
+
+//update button  
+ extern char *pbutn_update ; 
+/////////////////////
+
+
+//clear-button 
+ extern char *pbutn_clear ; 
+/////////////////////
+
+
+// 
+ extern char *puser_statis ; 
+/////////////////////
+
+
+// 
+ extern char *pusernum ; 
+/////////////////////
+
+
+// 
+ extern char *puser_maxnum ; 
+/////////////////////
+
+
+// 
+ extern char *pavenum ; 
+/////////////////////
+
+
+// 
+ extern char *pserv_stat ; 
+/////////////////////
+
+
+// 
+ extern char *pclassID ; 
+/////////////////////
+
+
+// 
+ extern char *pclassName ; 
+/////////////////////
+
+
+// 
+ extern char *pteacherID ; 
+/////////////////////
+
+
+// 
+ extern char *prmcu_id ; 
+/////////////////////
+
+
+// 
+ extern char *pfocus_stuID ; 
+/////////////////////
+
+
+// 
+ extern char *pclass ; 
+/////////////////////
+
+
+// 
+ extern char *pteacherName ; 
+/////////////////////
+
+
+// 
+ extern char *pteacherIP ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher ; 
+/////////////////////
+
+
+// 
+ extern char *pstuID ; 
+/////////////////////
+
+
+// 
+ extern char *pstuName ; 
+/////////////////////
+
+
+// 
+ extern char *pstuIP ; 
+/////////////////////
+
+
+// 
+ extern char *pstu ; 
+/////////////////////
+
+
+// 
+ extern char *prmcu_name ; 
+/////////////////////
+
+
+// 
+ extern char *prmcuIP ; 
+/////////////////////
+
+
+// 
+ extern char *prmcu ; 
+/////////////////////
+
+
+// 
+ extern char *psemcu_id ; 
+/////////////////////
+
+
+// 
+ extern char *psemcu_name ; 
+/////////////////////
+
+
+// 
+ extern char *psemcu_ip ; 
+/////////////////////
+
+
+// 
+ extern char *psemcu ; 
+/////////////////////
+
+
+// 
+ extern char *pok ; 
+/////////////////////
+
+
+// 
+ extern char *pversion ; 
+/////////////////////
+
+
+// 
+ extern char *pInit ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_sed_text ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher_login ; 
+/////////////////////
+
+
+// 
+ extern char *perror001 ; 
+/////////////////////
+
+
+// 
+ extern char *perror002 ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher_logout ; 
+/////////////////////
+
+
+// 
+ extern char *prmcu_login ; 
+/////////////////////
+
+
+// 
+ extern char *perror004 ; 
+/////////////////////
+
+
+// 
+ extern char *prmcu_logout ; 
+/////////////////////
+
+
+// 
+ extern char *perror005 ; 
+/////////////////////
+
+
+// 
+ extern char *perror006 ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_logout ; 
+/////////////////////
+
+
+// 
+ extern char *ptcher_crclass ; 
+/////////////////////
+
+
+// 
+ extern char *ptcher_canlclass ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_join ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_out ; 
+/////////////////////
+
+
+// 
+ extern char *prmcu_exit_class ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher_send_groupmage ; 
+/////////////////////
+
+
+// 
+ extern char *pclass_commu ; 
+/////////////////////
+
+
+// 
+ extern char *pclass_teach ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_appli ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_appli_cancel ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_send_groupmage ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_get_classinfo ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_get_stulist ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher_option_rstu ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher_cancel_rstu ; 
+/////////////////////
+
+
+// 
+ extern char *pteacher_get_stulist ; 
+/////////////////////
+
+
+// 
+ extern char *pamcu_login ; 
+/////////////////////
+
+
+// 
+ extern char *perror007 ; 
+/////////////////////
+
+
+// 
+ extern char *perror008 ; 
+/////////////////////
+
+
+// 
+ extern char *pamcu_logout ; 
+/////////////////////
+
+
+// 
+ extern char *pamcu_get_classinfo ; 
+/////////////////////
+
+
+// 
+ extern char *pamcu_join ; 
+/////////////////////
+
+
+// 
+ extern char *pamcu_exit ; 
+/////////////////////
+
+
+// 
+ extern char *pallow_chat ; 
+/////////////////////
+
+
+// 
+ extern char *pstarted ; 
+/////////////////////
+
+
+// 
+ extern char *pforbid_chat ; 
+/////////////////////
+
+
+// 
+ extern char *perror003 ; 
+/////////////////////
+
+
+// 
+ extern char *pstu_login ; 
+/////////////////////
+
+ 
+#endif

Added: incubator/bluesky/trunk/RealClass/TServer/src/lissocket.cpp
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/lissocket.cpp?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/lissocket.cpp (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/lissocket.cpp Mon Nov 30 11:24:38 2009
@@ -0,0 +1,64 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+// LisSocket.cpp: implementation of the CLisSocket class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "lissocket.h"
+#include "clientsocket.h"
+#include "adminserver.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CLisSocket::CLisSocket()
+{
+
+}
+
+CLisSocket::~CLisSocket()
+{
+	ShutDown(both);
+	Close();
+
+}
+
+void CLisSocket::OnEvent()
+{
+	CClientSocket accept;
+	int count[THREADCOUNT];
+	int t, min;
+	if(m_lEvent == 1){		//Accept socket.
+		printf("\nLinstening.................");
+		if(Accept(accept)){
+			for(t=0; t<THREADCOUNT; t++){
+				count[t] = m_pServer->m_accept[t].GetCount();
+			}
+			for(t=0, min=0; t<THREADCOUNT; t++){
+				if(count[min] > count[t]) 
+					min = t;
+			}
+			if(m_pServer->m_accept[min].AddSocket(accept.Detach())){
+				printf("\nAccepted a connect................");
+			}
+		}
+	}
+	return ;
+}

Added: incubator/bluesky/trunk/RealClass/TServer/src/lissocket.h
URL: http://svn.apache.org/viewvc/incubator/bluesky/trunk/RealClass/TServer/src/lissocket.h?rev=885379&view=auto
==============================================================================
--- incubator/bluesky/trunk/RealClass/TServer/src/lissocket.h (added)
+++ incubator/bluesky/trunk/RealClass/TServer/src/lissocket.h Mon Nov 30 11:24:38 2009
@@ -0,0 +1,39 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License. 
+
+// LisSocket.h: interface for the CLisSocket class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(LISSOCKET_H)
+#define LISSOCKET_H
+
+#include "asyncsocketex.h"
+
+class CAdminServer;
+class CLisSocket : public CAsyncSocketEx  
+{
+public:
+	CLisSocket();
+	virtual ~CLisSocket();
+
+	CAdminServer* m_pServer;
+protected:
+	virtual void OnEvent();
+};
+
+#endif // !defined(LISSOCKET_H)



Mime
View raw message