| 69 | } |
| 70 | |
| 71 | public String login(String username, String hostIp, String hostPort) { |
| 72 | this.username = username; |
| 73 | String login_mess = null; |
| 74 | try { |
| 75 | c_socket = new Socket(hostIp, Integer.parseInt(hostPort)); |
| 76 | } catch (NumberFormatException e) { |
| 77 | login_mess = "���ӵķ������˿ں�portΪ����,ȡֵ��ΧΪ��1024<port<65535"; |
| 78 | return login_mess; |
| 79 | } catch (UnknownHostException e) { |
| 80 | login_mess = "������ַ����"; |
| 81 | return login_mess; |
| 82 | } catch (IOException e) { |
| 83 | login_mess = "���ӷ�����ʧ�ܣ����Ժ�����"; |
| 84 | return login_mess; |
| 85 | } |
| 86 | return "true"; |
| 87 | } |
| 88 | public void showChatFrame(String username) { |
| 89 | getDataInit(); |
| 90 | c_chatFrame = new Client_chatFrame(this,username); |