Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public class TCP_Client
- {
- Public static void main (String[] args)
- {
- Try
- {
- InetAddress address = InetAdreess.getByName(“127.0.0.1”);
- Socket CliSock = new Socket(address);
- PrintStream outs = new PrintStream(CliSock.getOutputStream());
- BufferedINputStream inps = new BufferedInputStream(CliSock.getInputStream());
- Outs.print(“message”);
- Inps.write(“received data”):
- CliSock.Close();
- }
- Catch(Exception e)
- {
- System.out.println(“Error: “ + e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement