Programming Tutorials

Comment on Tutorial - TCP Server and TCP Client in Java By Ashish Myles



Comment Added by : newbee

Comment Added at : 2015-04-15 13:21:55

Comment on Tutorial : TCP Server and TCP Client in Java By Ashish Myles
hey im a novice in java...so i have to make a connection to another machine and send data using tcp/ip!
How do i get this done?
I tried this:

import java.io.IOException;
import java.net.Socket;
import java.net.InetSocketAddress;
import java.net.SocketAddress;



Socket connection = new Socket(server,AGREED_PORT_NUMBER);
makeRequestToServer(connection);
getReplyFromServer(connection);

connection.close();

But got an error saying TYPED VARIABLE DECLARATION-OBJECT CONSTRUCTOR


View Tutorial