public static int sendTo(int socketID, byte[] str, int len) { int ret = -1; if (m_clients.containsKey(socketID)) { FCClientSocket client = m_clients.get(socketID); ret = client.sendTo(str, len); } return(ret); }
public static int close(int socketID) { int ret = -1; if (m_clients.containsKey(socketID)) { FCClientSocket client = m_clients.get(socketID); ret = client.close(); m_clients.remove(socketID); } return(ret); }
public static int connect(int type, int proxyType, String ip, int port, String proxyIp, int proxyPort, String proxyUserName, String proxyUserPwd, String proxyDomain, int timeout) { FCClientSocket client = new FCClientSocket(type, (long)proxyType, ip, port, proxyIp, proxyPort, proxyUserName, proxyUserPwd, proxyDomain, timeout); ConnectStatus ret = client.connect(); if (ret != ConnectStatus.CONNECT_SERVER_FAIL) { m_socketID++; int socketID = m_socketID; client.m_hSocket = m_socketID; m_clients.put(socketID, client); return(socketID); } else { client.delete(); return(-1); } }