Recent Posts
None | 6 sec ago
PHP | 30 sec ago
None | 39 sec ago
PHP | 49 sec ago
C++ | 55 sec ago
None | 1 min ago
ActionScript 3 | 1 min ago
None | 1 min ago
None | 2 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By TCPClientjava on the 15th of Sep 2008 11:14:44 AM
Download |
Raw |
Embed |
Report
import java.io.*;
import java.net.*;
public class TCPClient{
int port = 6789; //default
if (argv.
length > 0
) port
= Integer.
parseInt(argv
[0
]);
// To server on local host
// To server on other host with IP-address = 83.92.58.109
//Socket clientSocket = new Socket("83.92.58.109", port);
clientSocket.getOutputStream());
String sentence
= inFromUser.
readLine();
outToServer.println(sentence);
String modifiedSentence
= inFromServer.
readLine();
System.
out.
println("FROM SERVER: " + modifiedSentence
);
clientSocket.close();
}
}
Submit a correction or amendment below.
Make A New Post