📄 csocket.java
字号:
import java.io.*;
import java.net.*;
/**
* Get a connection through Socket and get the socket's DataInputStream and DataOutputStream.
* <p>2005.8.29
* @version 0.1.2
* @author Daxin Tian
*
*/
public class Csocket {
Socket c_socket;
public DataInputStream c_dis=null;
public DataOutputStream c_dos=null;
public boolean Cconnect(String address, int port)
{
try
{
c_socket=new Socket(address,port);
c_dis=new DataInputStream(c_socket.getInputStream());
c_dos=new DataOutputStream(c_socket.getOutputStream());
return true;
}
catch(IOException e)
{
return false;
}
}
public void Cclose()
{
try
{
c_socket.close();
}
catch(IOException e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -