📄 cmppsocket.java
字号:
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov Date: 2004-4-16 11:12:25
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: cmppSocket.java
package com.aspire.cmppApi;
import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;
public final class cmppSocket
{
public cmppSocket(String s, int i)
{
host = s;
port = i;
sock = null;
bout = null;
din = null;
seq = 1;
}
public cmppSocket(Socket socket)
{
sock = socket;
}
public int InitialSock()
{
int i = 0;
try
{
if(sock == null)
sock = new Socket(host, port);
sock.setTcpNoDelay(true);
bout = sock.getOutputStream();
din = new DataInputStream(sock.getInputStream());
seq = 1;
}
catch(UnknownHostException unknownhostexception)
{
System.out.println(host + " is not legal host address...");
System.out.println(unknownhostexception.toString());
i = -2;
return i;
}
catch(IOException ioexception)
{
System.out.println(port + " is not available ...");
System.out.println(ioexception.toString());
i = -3;
return i;
}
return i;
}
public int closeSock()
{
int i = -1;
try
{
if(sock != null)
sock.close();
i = 0;
}
catch(IOException _ex)
{
i = -1;
return i;
}
return i;
}
public Socket sock;
public String host;
public int port;
public int seq;
public OutputStream bout;
public InputStream din;
public static final int outsize = 51200;
public static final int insize = 51200;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -