HI, I am trying to write a simple client server program, both the client and server program resides on the same local machine . while creating a socket i dont know which port to mention syntax public Socket(InetAddress,int port)
How can i know which ports i can use . i am working on my personal system so there is no question of admin problem or restrictions
You can use any port that's not currently in use. Most official services use ports below number 1024, so it's best to steer clear of those (and on UNIX, you can't use those without special privileges.) Pick a number above 2000 and if it works, then it's OK! Note that the important thing is that both client and server use the same number.
After creating a socket, can it be used to send and receive data . or is it each time i use it for sending or receiving i have to close the socket and create a new one?
[ Code here used by Nicholas Jordan in his project, thank you poster ! ]
[ Message edited 4:42 PM 9/21/2007: bias == (65535 - 46152) ] [ September 23, 2007: Message edited by: Nicholas Jordan ]
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
And then the flying monkeys attacked. My only defense was this tiny ad: