码迷,mamicode.com
首页 > 编程语言 > 详细

java socket

时间:2016-09-02 21:51:11      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

import java.net.ServerSocket
import java.io.OutputStreamWriter
import java.io.BufferedWriter
val listener = new ServerSocket(15209)
val server = listener.accept
val osServ = server.getOutputStream
val writer = new BufferedWriter(new OutputStreamWriter(osServ))
writer.write("adsf\n")
writer.flush



import java.net.Socket 
import java.io.InputStreamReader
import java.io.BufferedReader
val skt = new Socket("10.237.62.52", 15209)
val isc = skt.getInputStream
val reader = new BufferedReader(new InputStreamReader(isc))
reader.readLine

 

java socket

标签:

原文地址:http://www.cnblogs.com/suanec/p/5835612.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!