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

change html code in socket input stream and pass to client in java

I want a proxy in java that get response of a server in socket and change the html code and then pass the client as a response in socket connection. Now My program can get request from client and can get response that from server and pass that to…
arVahedi
  • 107
  • 1
  • 3
  • 15
0
votes
2 answers

Set SO_LINGER socket option to ServerSocket in java

How to set SO_LINGER socket option to ServerSocket? Should i extend SocketImpl class. But there are many abstract methods in SocketImpl class.
Praveen Kumar
  • 946
  • 3
  • 10
  • 29
0
votes
1 answer

Set SO_EXCLUSIVEADDRUSE using Java

In java how to set SO_EXCLUSIVEADDRUSE flag to serversocket? Am not able to find the API call for this in ServerSocket API. I can set SO_TIMEOUT using setSoTimeout method. But how to set SO_EXCLUSIVEADDRUSE?
Praveen Kumar
  • 946
  • 3
  • 10
  • 29
0
votes
0 answers

ServerSocket in Java application running in Azure Virtual Machine with Ubuntu?

I've created an Ubuntu Virtual Machine in Microsoft Azure and uploaded a Java application which uses a java.net.ServerSocket to handle incoming messages I send - with java.net.Socket - to port 20000. This application works perfectly in any machines,…
LucasBatalha
  • 43
  • 1
  • 8
0
votes
1 answer

Socket clientSocket = serverSocket.accept(); cannot be resolved

I really can't work out why this wont work... It seems to work everywhere else I've seen it. try { ServerSocket serverSocket = new ServerSocket(6644); } catch (IOException e) { e.printStackTrace(); } while(true){ Socket clientSocket =…
Neguido
  • 235
  • 2
  • 13
0
votes
1 answer

Connection refused: connect error

I am trying to send a text file from the sender to the receiver however on the sender side I get connection refused: connect. I use a localhost address on the receiver side and I manually enter it in when prompt on the sender side. The error occurs…
user3339242
  • 631
  • 2
  • 15
  • 32
0
votes
1 answer

Reading a file into byte array and transferring it to be read into a new file

My project is to write a server and client class. The server waits to receive a path for a file which it will convert from CSV to XML and then it's supposed to read the contents of the file back to the client who will save the content into a new…
Arian.No
  • 3
  • 1
  • 5
0
votes
1 answer

Hosting a java server program to listen at a port

I want to test an application written in Java socket programming. I have a client machine which has a dynamic ip. I want to connect to a server program in the server and send some data. What I did earlier was running the server application in a…
0
votes
1 answer

(Java/Android) Client-side Socket throwing IOException

I'm trying to connect 2 Android devices through sockets, but why isn't it working? I've tried replacing the Host Address with IP Address but it didn't work out. Server Side (extends AsyncTask): ServerSocket server; int port; String hostName server…
cruelcore1
  • 578
  • 4
  • 22
0
votes
1 answer

In Java How to receive http and non http(udp,..etc)

In my java application,i want to receive http and non http requests and process these requests.Please let me know how to do this through socket programming os is there any way to do in the Spring framework. Thanks in advance.
santro
  • 373
  • 1
  • 6
  • 22
0
votes
1 answer

Python Sockets connect to FTP don't receive what I expect

I am using python socket to connect to ftp.rediris.es and I don't receive the answer I expect after sending data. I explain this better with my code and answers: This is my code (test.py) #!/usr/bin/env python import socket s =…
aDoN
  • 1,877
  • 4
  • 39
  • 55
0
votes
2 answers

Can ServerSocket write to client before reading from client?

After a ServerSocket accepts a connection to a client, can the ServerSocket start writing data to the client before the client sends a message? When I try to write to the client from the ServerSocket first, the client is blocking forever tyring to…
0
votes
2 answers

ServerSocket times out and exits server program

I'm trying to implement a server that accepts connections but times out and closes that specific connection only if it hasn't received anything from that connection after N milliseconds. From my possible misunderstanding of ServerSocket's…
cbrad
  • 163
  • 1
  • 15
0
votes
0 answers

Android client to java server

I want to create an application on android that checks if user is in the server database. At this moment, i just try to make connection work. This is my client code : public class Client { public void testConnexion() { new…
Kurei
  • 1
  • 1
0
votes
0 answers

Is it possible to transfer (a String, for example) from a TCP Server to a UDP Client?

I'm working on TCP and UDP just to learn the basics of how networks and protocols work in Java, and the task my professor has set me is to have the following: A TCP Client that connects to a TCP Server, which communicates with a UDP Client that…
Jona
  • 1,023
  • 2
  • 15
  • 39