/ Published in: Java
A simple implantation of sockets input and output
Expand |
Embed | Plain Text
import java.net.*; import java.io.*; class .... static String domain; static int port; static InetAddress addr; static BufferedReader in; static BufferedWriter out; static Socket sock; static String line; domain = d; port = p; try { } { } } //Data to Output to the socket try { out.write("Data to send"); out.flush(); } {} //read data from socket try { while((line = in.readline()) != null) { } {}
You need to login to post a comment.
