/ Published in: Java
A simple implantation of sockets
input and output
input and output
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import java.net.*; import java.io.*; class .... static int port; 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) { } {}