Java??C#???SOCKET????????
???????????? ???????[ 2013/7/10 11:30:49 ] ????????
????c)????????????????????
outWriter.println(strInfo);
outWriter.flush();
????d)?????????????????
// ???????????
File file = new File(filePath);
byte[] outBytes = new byte[1024];
int count = 0;
FileInputStream fileInput = new FileInputStream(file);
ByteArrayOutputStream ow = new ByteArrayOutputStream();
while ((count = fileInput.read(outBytes)) > 0) {
MyLogManager.DebugLog(log?? null?? String.valueOf(count));
ow.write(outBytes?? 0?? count);
}
outPut.write(ow.toByteArray());
//outWriter.print(ow);//?????JAVA???????????????????????C#???????????????
//outWriter.flush();
?????????????????java??c#?????汾??
????1).???????????????????????
????????JAVA???????????PrintWrite???println()???????ɡ?
??????????C#???????????socket.Send(System.Text.Encoding.ASCII.GetBytes(msg + " "))??????????????msg???????????н??????????
????2).?????????????????????
????2-1).java????????????
????a)java?????????????????
******???????*****
log.info("????????????");
InetAddress address = InetAddress.getByName(AppConfig.IP);//193.100.100.143);
SocketChannel sc = SocketChannel.open(new InetSocketAddress(address??AppConfig.PORT));
log.info("????????????");
//?????? ???????
InputStream inputStream = Channels.newInputStream(sc);
InputStreamReader is = new InputStreamReader(inputStream??"GBK");
in = new BufferedReader(is);
log.info("???????????????");
String responseLine="";
while ((responseLine = in.readLine()) != null)
{
//??readLine???????????????????????з???????????????????????????????????????б????
returnStr += responseLine+"
";
}
log.info("??????????????????");
**************
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11