日期:2014-05-20 浏览次数:20818 次
if(mytaskstate == 1){
System.out.println("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB");
D_port_Calc_The_CustomerSysFuctionUserRightsCode cjco = new D_port_Calc_The_CustomerSysFuctionUserRightsCode();
String MyCustomerServiceOrdernum = cjco.getMyUserRights(MyUserRights);
SocketClient so = new SocketClient(MyObjIP,5555);
String mycustomerordernum = "6丗6丗"+MyCustomerServiceOrdernum+"丠"+"Cus"+"丠"+"99999999"+"丠"+"IneedOrders丮false" +"丗"+"D";
so.writeStr(mycustomerordernum, "ManageOurAuthorizeRightsConfirmCode");
so.getMyResourceBack();
System.out.println("OKay!!The Data I Out put is:"+mycustomerordernum);
}
while(true){
Socket s1 = soo1.nextSocket();
IP = s1.getInetAddress();
MyObjIP = IP.toString().substring(1);
synchronized(s1){
try {
buffertemp3 = soo1.read(s1);
} catch (IOException e) {
// TODO Auto-generated catch block
new NoteUserSysIsInDefending();
}
}
//////"D-C传输一笔数据");
// //////////"C端接收到S端的数据!!D-C端系统信道启动!!");
// ////buffertemp3);
//////"C端接收到的数据:buffertemp3----->"+buffertemp3);
System.out.println("GetDportSocket类接收到的服务器的传输数据" + buffertemp3);
String[] bufferData3 = buffertemp3.split("丗");
System.out.println("GetDportSocket类接收服务器传输数据的字符串数组"+bufferData3);
sign3 = Integer.parseInt(bufferData3[0]);
System.out.println("GetDportSocket类接收到的数据第一字段:sign3----->"+sign3);
para3 = Integer.parseInt(bufferData3[1]);
System.out.println("GetDportSocket类接收到的数据第二字段:para3----->"+para3);
SocketInfo = bufferData3[2];
System.out.println("GetDportSocket类接收到的第三字段:SocketInfo----->"+SocketInfo);
MyUserRole = bufferData3[3];
System.out.println("GetDportSocket类接收到的第四字段:MyUserRole----->"+MyUserRole);
MyObjIP = bufferData3[4];
System.out.println("GetDportSocket类接收到的第五字段:MyObjIP----->"+MyObjIP);
MyThreadname = bufferData3[5];
System.out.println("GetDportSocket类接收到的D端的线程:MyThread----->"+MyThreadname);
package c_port_packageBJTeacher;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;
public class SocketServer {
private ServerSocket ss = null;
private Map<Socket, BufferedReader> rm = new HashMap<Socket, BufferedReader>();
private Map<Socket, PrintWriter> wm = new HashMap<Socket, PrintWriter>();
String MyKey = "CJCO5888CJCO";
BufferedReader br = null;
PrintWriter pw = null;
public SocketServer(int port) {
try {
ss = new ServerSocket(port);
} catch (IOException e) {
e.printStackTrace();
}
}
public Socket nextSocket() {