What are the characteristics of handling Socket and ServerSocket ?
handling Socket handled in the client side
client sent a request and it has to wait for the server to respond where the connection of the client and server should be alive so that it can be maintined to send data from one end to another end so there is time frame to stay connected.
when the client sent a request the server listens to the port which is assigned in the program and it has a hostname and ip adddress so that it will find the correct server to get the response from the server.
the following are the process that might happen for transfering data
connect,connecting,disconnect,error,reconnect,reconnect failed.
there is also error handling method available reconnect failed() where the server gives a actions to client to wait for connect or close the client .we can specify some other handling methods to handle error in the connection for making the system more reliable.
server
ServerSocket S = new ServerSocket(9000)//listens to port and the port number is always assigned to it
through this port only the connection is established.
there is ServerSocket.accept() method for each connection where after approval only the connection get approved. there is only one accept method opened for the connections.
then the close method is used to close the connection to the server.
what is a socket? what is the difference between a socket object and a ServerSocket object?
3. List the different groups of ground handling service providers. What are the main characteristics of each group? 4. Which are the three key international ground handling bodies/agencies? Who do they represent
What are the key tuples in the UDP socket and TCP socket?
Using java socket programming rewrite the following program to handle multiple clients simultaneously (multi threaded programming) import java.io.*; import java.net.*; public class WelcomeClient { public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println( "Usage: java EchoClient <host name> <port number>"); System.exit(1); } String hostName = args[0]; int portNumber = Integer.parseInt(args[1]); try ( Socket kkSocket = new Socket(hostName, portNumber); PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true); BufferedReader in = new BufferedReader( new InputStreamReader(kkSocket.getInputStream())); ) { BufferedReader...
Why am I getting "java.net.BindException: Address already in use: NET_Bind" error? My code is below: public ServerSocket server = null; public static void run() throws FileNotFoundException{ PrintWriter logFile = new PrintWriter("C:OutFile.log.txt"); var date = new java.util.Date(); var nDate = date.toString(); try { ServerSocket ss = new ServerSocket(1234); Socket s = ss.accept(); //log connection time logFile.printf("Got a Connection: ",...
I'm busy experimenting with TCP socket connnections. I have made a client SOCK_STREAM socket andi've got a few questions: + Is there any way that a streaming(TCP) socket can get data from another socket without having to connect to it? + Is it safer to have a socket that a client connects to send data, and another one that the client gets data from (the server sockets exchange data) instead of one up and down socket? Because what i'm trying...
5. What is a Port and why is it necessary? 6. What is a Socket? What is it used for? 7. Describe Multiplexing. Describe Segmentation. How are they different?
create a tic tac toe socket programming in c \\\ using windows socket \\\\\\\
Write technical report about the socket programming which should include the followng: Introduction about the socket programming Advantages of socket programming Create TCP/IP Client (the source code in any language) socket program that performs the following steps: a. Initializes Winsock. b. Creates a socket. c. Connects to the server. d. Sends and receives data. e. Disconnects. create TCP/IP Server socket program that performs the following steps: a. Initializes Winsock. b. Creates a socket. c. Listen for client. d. Receives and...
Air handling unit HVAC Analysis known ambient air characteristics: Relative humidity = 55% air is 79% n2 and 21% o2 I have the mole fractions and the mass fractions entering the fan the fan has a inlet pressure = atmospheric = 0 psig = 14.7 psia fan characteristics: fan duct = 4ft diameter air mixture velocity = 14ft/second the fan outlet pressure is 0.9 psig = 15.6 psia with a known fan fluid efficiency of 60% and know CV and...