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

How to transfer [String] information through a socket

I'm trying to make a client chat application using Java I want to transfer messages but Its seems like its not working. Typing is a JTextField Button is a button (No way :O) and ChatView is the JTextAreafor sending messages between the clients Leave…
Samuel Musa
  • 68
  • 2
  • 11
0
votes
1 answer

How to set timeouts between connections using gevent.server in Python?

How to set timeouts between connections using gevent.server in Python? from gevent.server import StreamServer def handle(socket, address): message = socket.recv(1024) if __name__ == "__main__": server = StreamServer((SERVER_HOST,…
Snuff4uk
  • 61
  • 5
0
votes
1 answer

Broadcasting Data from one socket thread to all existing socket threads in java

i've a ServerSocket that listen to connections on a particular address and port and for each connection(client) make a thread in order to implement a stateful protocol,now each thread(client) messages process in it's own thread,here is the…
Francesco
  • 69
  • 3
  • 10
0
votes
0 answers

Client Server communication and underlying TCP states

I run the following Client-Server code on a linux box Server Code public class MyServer { public static void main(String[] args) { try { ServerSocket server = new ServerSocket(6868, 5); while…
TheMonkWhoSoldHisCode
  • 2,182
  • 3
  • 26
  • 40
0
votes
1 answer

onProgressUpdate doesn't update each time server receive data

I have used AsyncTask to establish the server socket connection, then accept the client connection, finally need to update the GUI each time the client send data to server. But what actually happen that when the client send data the GUI wasn't…
user1217585
0
votes
1 answer

Block socket connection for one port in JAVA

So basically I want my serversocket.accept() to be implemented for any other ports except 1218. Can I block the call from this port because 1218 has to connect to another thread.
0
votes
2 answers

How to send data in a java socket program without closing socket

i created a sever socket program to send a stream data to Apache spark.But data is received by spark after i close the socket or termination of program.i need to send data without closing socket and terminating program. import…
BlackPOP
  • 5,657
  • 2
  • 33
  • 49
0
votes
1 answer

SocketServer AttributeError: Instance has no attribute 'request'

I have an issue with this mini game that i made which i am trying to add to a server. I am trying to print a function from an instance of a Character but i'm not sure how to pass the proper function in. This is what i have: class…
12vi6
  • 50
  • 8
0
votes
1 answer

ServerSocket on port 80 is it correct?

I read some materials about ServerSocket and tried to listen on port 80 and print for example InetAddress of website which I was opening in web browser but my program couldn't do this. My code: import java.io.IOException; import…
Kabun
  • 35
  • 3
0
votes
0 answers

Host ServerSocket on Android device

I'm trying to develop an app listening on a ServerSocket. When I try to connect to it from another application installed on my phone, everything works. However, it is unreachable from an external client (I am connected with 3G). Why? Is there a…
ssnape
  • 37
  • 9
0
votes
1 answer

Receive tracking equipment faulty string

I'm developing a socket server that will receive data from a Chinese tracking equipment, the TK-06A. So did my server that is receiving the following information: �L�l}�8��� What do you think you can be? What enconde I use to resolve…
0
votes
1 answer

Java: coding for persistent connections

So I'm creating a web server. I think I've got everything pretty much good to go, but the one thing that is baffling me is persistent connections. I've got the logic set up so that it will detect if 'Close connection' was specified. If so it will…
planner15
  • 53
  • 8
0
votes
1 answer

ObjectOutputStream not updating

I'm working on a server, where the serverclass creates a new thread for each connected client, and when the client is connected, the ObjectOutputStream won't refresh on serveral connected clients. It is…
0
votes
1 answer

Can't figure out why i'm getting an exception for my method

So i'm making a server socket I call the constructor to constuct the serversocket then call the getLocalPort method to get the local port but server.getLocalPort(); is throwing a null pointer exception and I can't figure out why i'm stumped. I'm…
Joe
  • 337
  • 2
  • 16
0
votes
1 answer

Error closing ServerSocket after file transfer Java

I have the code below When I do not have the close ServerSocket statement I get an error saying it is a resource leak but when I add the close statement Eclipse tells me the code is unreachable, How can I change the code to close the socket outside…
user3389199
  • 5
  • 1
  • 4