MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / login

Method login

day26/resource/chat_socket_client/src/com/elient/Client.java:71–87  ·  view source on GitHub ↗
(String username, String hostIp, String hostPort)

Source from the content-addressed store, hash-verified

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);

Callers 1

actionPerformedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected