日期:2014-05-20 浏览次数:20752 次
public void receiveTheData(){
try {
DataInputStream dips3 = new DataInputStream(so3.getInputStream());
while(true){
C_portManageRecvDportData m8 = new C_portManageRecvDportData(so2);
m8.start();
try{
buffertemp3 = dips3.readUTF();
}catch(EOFException e){
System.out.println(buffertemp3);
String[] bufferData3 = buffertemp3.split("[#]");
sign3 = Integer.parseInt(bufferData3[0]);
para3 = Integer.parseInt(bufferData3[1]);
SocketInfo = bufferData3[2];
switch(sign3){
case 0:
{
switch(para3){
case 0:
{
break;
}
}
}
case 1:
{
}
case 2://接收S端的数据,让C端的客户端将好友的消息进行接收.
{
DataOutputStream dops3 = new DataOutputStream(so3.getOutputStream());
ManageC_portRecv_chatwordChannel1 m1 = new ManageC_portRecv_chatwordChannel1(SocketInfo,dops3,dips3);
m1.start();
PlaySysAudio.Play(InfoAccessPath);
break;
}
case 4://接收S端传至C端的好友IP地址。
{
casebuffer = SocketInfo.split("[|]");
case 3://
{
MySystemserialnum = Integer.parseInt(SocketInfo);
break;
}
MyFriIP = casebuffer[0];
MyFriPort = casebuffer[1];
MyFriNum = casebuffer[2];
MyFriRole = casebuffer[3];
PlaySysAudio.Play(IPAccessPath);
break;
}
case 10:
{
ManageGetTheS_port_PayForTheSysFuctionSignal m10 = new ManageGetTheS_port_PayForTheSysFuctionSignal(para3,SocketInfo);
m10.start();
break;
}
}
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}]
static String readsocketUTF(Socket s){
DataInputStream read = null;
try {
read = new DataInputStream(s.getInputStream());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String msg = "";
String info = "";
msg = info;
while(true){
try {
info = read.readUTF();
}catch(EOFException e){
break;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
msg = msg + info;
return msg;
}