Questions tagged [serversocket]

ServerSocket is a java.net class that provides a system-independent implementation of the server side of a client/server socket connection.

ServerSocket is a java.net class that provides a system-independent implementation of the server side of a client/server socket connection.

A server socket's job is to set up the communication endpoint and passively wait for requests to come in over the network.

Further Reference

Related Tags

1869 questions
0
votes
1 answer

is.readUTF() not recieving message

For the chat program in android side I am sending message via DataInput stream as Socket sck = new Socket(); sck.connect(new InetAddress("192.168.1.91",1500),2000); if(sck.isConnected()) { DataOutputStream os = new…
0
votes
3 answers

How to stop background socket thread

I have created app that will send audio streaming to server when user click on start button.For that i created a socket thread to send audio to server.And it stop after pressing the stop button.It works perfect,But the problem is that when i start…
Avinash Aher
  • 77
  • 2
  • 10
0
votes
1 answer

""Connection reset"" error after connected to second client in instant messaging application

It seems like the connection is reset after the second client is connected This is the first client, I have commented most of the line to make is clearer import java.awt.BorderLayout; import java.awt.event.ActionEvent; import…
syafihakim
  • 81
  • 2
  • 10
0
votes
1 answer

Send messsage from server to GPS device

I have been using TK06A GPS tracker and I 'm developing my own server java file and I have received the initial login message packet as per the TK06A manual and now I need to send back the ack to the device to get the GPS message packet. I am not…
0
votes
1 answer

ServerSocket doesn't appear in Netstat?

Very confused, I just posted this question but deleted it because I made many mistakes. Alright well here goes again! I have a server program in java below. When I run it I expect to see some sort of presence in netstat, but I see nothing. Here are…
nhooyr
  • 1,104
  • 1
  • 13
  • 31
0
votes
2 answers

Keep communication open between server and client - Java

How do you make a client which is able to send a server multiple messages at anytime, and therefore a server listening for a message all the time. Right now I have wrote some code which only allows me to send a message once. I thought this was due…
Anthony Cannon
  • 1,245
  • 9
  • 20
0
votes
3 answers

Arg[0] declaration as default

I am coding a server-client java program. The code was supposed to be running on command prompt after server run of java server as: Client user Where client is the name of the user which will be passed to args[0]. In order to take care of the…
user893970
  • 889
  • 6
  • 17
  • 28
0
votes
0 answers

"Address already in use" even though setReuseAddress(true)

Even though I call ServerSocket.setReuseAddress(true), I still get java.net.BindException: Address already in use on some machines if the port has been recently used. InetSocketAddress isa = new InetSocketAddress(13025); ServerSocket serverSocket =…
John Farrelly
  • 7,289
  • 9
  • 42
  • 52
0
votes
1 answer

socket hangs after idle time :server - client java program

Hi i have written a server program to receive ISO8583-93 version requests process them and send response.I will be receiving continuous requests.It works fine ,but if socket is idle when the next request comes, server is not reading. Please find…
jan
  • 55
  • 7
0
votes
1 answer

ServerSocket closed with unknown reason

I write some scala code, which is used for shuffle. The code is just like the following, but the serverSocket closed unexpected, the serverSocket will start(I observed using netsta), but after a while, it will be closed. private val…
Djvu
  • 605
  • 1
  • 5
  • 18
0
votes
0 answers

Why does my Client freeze when awaiting a response from the Server?

I have two separate Java projects, one a client and one a server. The server is set up to take specific commands from a client and respond to the command depending on what it is. The following is the connection portion of the client: private class…
Benjamin
  • 345
  • 2
  • 3
  • 15
0
votes
1 answer

How to connect a socket with android using wifi direct

I am trying to connect to a socket from the client to the server using wifi direct so I have this code on the server: ServerSocket serverSocket = new ServerSocket(2009); Socket client = serverSocket.accept(); and I have this code on the…
arezkibe
  • 13
  • 1
  • 6
0
votes
2 answers

Why do I get an exception during wifi direct socket connection?

I got a exception when I run that code on my android server device but I don't understand why, can you please help me. WifiP2pDevice peer = wifiP2pDeviceList.getDeviceList().iterator().next(); String host = peer.deviceAddress; ServerSocket…
arezkibe
  • 13
  • 1
  • 6
0
votes
0 answers

handling multiple clients using select

As i already asked similar questions but didn't get a solution. Hence i put this problem again with the whole code. Please tell me how can i acheive this goal 1) i have a client which sends to mainserver (127.0.0.1) a message and main server…
bsnayak
  • 58
  • 7
0
votes
1 answer

Want to print only body part in my output not the http headers.. Http Request is handled using socket programming

I've written a server socket code that receives http request and print it on console. Given below is the server code. clientSocket = echoServer.accept(); is = new DataInputStream(clientSocket.getInputStream()); while (true) { line =…