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.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
20 views

keeps getting error while username and password is correct [closed]

the following block of code is suppose to get username from client side and if its equal to "Test" then ask for password and if its equal to "ok" then conncet to server, but it ...
1 vote
0 answers
15 views

Couldn't send message error from the Java ServerSocket

I am working on a legacy SOAP API client application. In the unit test cases, it's implemented to start a mock server using ServerSocket class and return a SOAP string response. Initially, that ...
0 votes
0 answers
21 views

Writed java file server. Somehow client can't do more than 1 operation

Idk am i right or not, but i think the problem is that i have to clear data array every iteration, but it doesnt work. At some point i've thought it might be other problem, but i dont know. at every ...
0 votes
0 answers
25 views

Sending POST request using http url connection java

I'm trying to configure a system client-server. The server uses a java server socket, and the client uses and http url connection to connect to the server. The code of the server is: private static ...
0 votes
0 answers
24 views

ServerSocket not receiving content (Java on Android, target is API 29)

Working in Android Studio, using Java, targeting API 29. I have what appears to be working code, with one glaring issue. Nothing is being received on the ServerSocket. When the code is run, the ...
  • 721
0 votes
1 answer
19 views

My java server not accepting multiple client requests in different Threads

Why is my Server program in Java not accepting anymore clients when I am running the client program more than once? Here's my code for server.java:- import java.net.*; public class Server { public ...
0 votes
0 answers
44 views

How to send escape sequences in a string over socket communication in Kotlin?

So for a University Project we are supposed to write a server which communicate with clients, Communication between server and robots is implemented via a pure textual protocol. Each command ends ...
0 votes
0 answers
174 views

A client of a Java ServerSocket does not/inconsistently receive a given number of bytes

While I was trying to send an Image (it's Bytes) and some other data over the Network via a Java ServerSocket, I found an interesting inconsistency in the code. I ran the same server- and client code ...
0 votes
0 answers
30 views

Send and receive number two Clients and Server with UDP Socket

I am writing a program using UDP which first ask a number from user in Client1 , then Server forward this number to another Client2, Client2 receive the number calculate the factorial and then send ...
  • 15
0 votes
0 answers
27 views

Dart Socket one at a time

Hi i am building a blockchain and am trying to sync a list of connected peers, but if the following code is called twice from different nodes the first call is still busy while the second call kicks ...
0 votes
0 answers
27 views

How to Receive a data from activemq to Server Socket(using netty) using apache camel

Basically what I am doing is that I am send data from server Socket(using netty) to activemq and then want to read the data from activemq to server Socket(using netty), From Server Socket to activemq ...
0 votes
0 answers
19 views

how to apply Nanomsg Protocol using Java NIO

I'm new the world of TCP / IP, Networking, Sockets etc.. during my internship I should replace the Nanomsg Library with java-only code. My supervisor has also sent me the following protocol and wants ...
  • 1
0 votes
0 answers
16 views

Is it possible in dart to put a certain key infront of your Socket ip

I have the following peer class class Peer { Peer({required this.count}); int count; Future listen(String ip, int port) async { ServerSocket ss = await ServerSocket.bind(ip, port); ss....
0 votes
1 answer
42 views

java http server implementation and JMEter testing

the control is reaching the put,get,post requests but i am unable to get the reply back from server, the http://localhost:8080 is throwing invalid ip error and jmeter test case is showing error ...
0 votes
1 answer
69 views

Share one ServerSocket connection to client between multiple threads in Kotlin

I am making a server application in Kotlin, and the server does following things: Bind a ServerSocket port let's say 10001. This port accepts TCP connection from clients (Users). Thread used. Works ...
  • 13
0 votes
1 answer
53 views

Client side socket isn't creating (ConnectException)

I have two machines with hostname q2 and w18 and I have a two simple program to send some message between these machines using socket. I have one file.cfg which contains the ip needs to be used by ...
2 votes
0 answers
36 views

Flutter WebViewPlus | "Unsupported operation: ServerSocket.bind" error

I want to display a local html file within my Flutter app. Therefore I decided to use the "webview_flutter_plus" package which is an extension of the "webview_flutter" package. ...
0 votes
1 answer
14 views

Server thread socket ignoring called method with readLine

I have a P2P network of nodes holding records of key:value, which can pass requests to other nodes on the network when the asked node doesn't hold the desired key. The operation always returns an &...
0 votes
0 answers
20 views

How to listen socket.io message without using event Listener in postman

When using postman event listener, I'm getting messages but problem is that, i don't want to listen to any event, then how can i get messages from the server I want to get all messages when the server ...
0 votes
0 answers
65 views

I've a problem with Socket connection in Java [Eclipse]

I've a problem with Socket communication and I don't know why Client and Server don't communicate. There are no syntax errors. This is the server code: `import java.io.*; import java.net.*; import ...
0 votes
1 answer
27 views

Why my ServerSocket doesn't receive message from socket?

My ServerSocket can't get message from socket. My class World with ServerSocket: package main; import panels.MainFrameConsole; import java.io.*; import java.net.ServerSocket; import java.net.Socket; ...
0 votes
0 answers
36 views

Problem with Server Class Socket in JAVA [Eclipse]

I've tried to develop this Server in Java with Eclipse, but when I run it says me this error: Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error, ...
0 votes
0 answers
30 views

Is it safe to use server socket(java) to create a webserver to host a basic webpage

I am a student and would like to webscrap a school site to get my assignments that aren't done yet. I already figured out how to webscrap the site, but I want to be able to see the information on my ...
0 votes
2 answers
31 views

Sending message between ServerSocket and client

I need to send a message from the ServerSocket to the client when the key is writable, I think that the message is being sent in the right way but when I try to read it on the client I get this error: ...
  • 97
0 votes
1 answer
60 views

How to send a video file from Java server socket to browser for downloading?

I am trying to implement a server using Java. When I try to send a file, such as video or pdf, the connection is always reset. I am currently using OpenJDK 11 and Ubuntu. void binaryResponse(...
0 votes
2 answers
165 views

Multi threading in custom socket server

I am building a socket server in c. This server is listening on a port. A huge number of clients will connect to this port. Each client will stay connected during hours. The clients will sometimes ...
  • 7,345
0 votes
1 answer
53 views

Trouble writing to OutputStream socket

I am writing a simple web server program for class that sends files to the web browser on request. I have written as much as I could. The difficulty is getting the data written to the OutputStream. I ...
  • 47
0 votes
1 answer
61 views

Python socket library: OSError: [WinError 10057] A request to send or receive data was disallowed because the socket is not connected

OSError: [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied. I am ...
0 votes
0 answers
74 views

Android Emulator - Connecting two emulator Instances via networking with different API-Level

I'm trying to develope an android application (with min-API-Level 28) with Java that communicates with an other device over a socket connection. One device is creating a Server instance and the other ...
  • 1
0 votes
0 answers
36 views

Esp server socket disconnected

Hy guys I´m trying to send a message from my phone in a server ESP32 but any app tcp connection that I try returns me disconnected. Im doing somehing wrong? my code is missing something... I don´t ...
  • 3
3 votes
2 answers
76 views

which `sock_fd` to use in `setsockopt` function

My client app uses socket as http connections, meaing one-time send,receive, and close, i considered using a single persistent connection, instead of separate connection, each time, but problem was, ...
0 votes
0 answers
25 views

Problem with sending images from web server to web client

I am doing an exercise on web server and I am having problem in sending image from server to client, I have read my .jpg image file into binary form and save it in a char array named new_buffer with ...
0 votes
1 answer
94 views

How to handle HTTP request using Java Socket?

I am trying to implement sample HTTP server using Java socket and executor service for concurrency. However every 2nd request is failing when I run the test using JMeter with 2 or more requests or ...
  • 175
0 votes
0 answers
55 views

Java Socket Remote Client-Server

I'm trying to make a connection unicast between a client and a server in Java. At the moment, I succeded in writing the code for making a connection between client and server only if the server is the ...
0 votes
1 answer
35 views

what should the server do when a conneceted client was force killed the process which both using tcp socket?

while using net and stream socket, after client connect server, what should the server do when a conneceted client was force killed the process which both using tcp socket? does the server know when a ...
  • 107
0 votes
1 answer
45 views

How to handle socket exceptions to make a continuous flow of program in Java?

I am creating a skribbl clone in Java using JavaFX and socket programming. I am sending data over a TCP connection using a objectinput/outputstream. Every 2/5 times the application runs without any ...
0 votes
0 answers
64 views

Client/Server communication with BeagleBone Black & Qt GUI application

How to send two-threaded data to Qt GUI app from BBB using xml format? Here is the code of the receiver: `` ` #include "mythread.h" #include <QDebug> #include <qmath.h> #include &...
  • 11
0 votes
1 answer
604 views

Connection Error in Socket.io in Native Android

I was creating a application using socket.io in native android application to communicate with websockets Tester. I have tested it using a online WebSocketServer , but each time when trying to check ...
  • 115
0 votes
0 answers
67 views

Python Socket Request Handler

I have a problem with the actual handling of a client/ server System. For a project I have a control unit, to which sensor data is sent. After that, I want the Control Unit to send the data to a ...
0 votes
0 answers
103 views

Multiple clients on server with multithreading using Socket Programming in C

I want to write some code using multithreading and sockets to create a server and this server can accept four connections (clients) How can I receive and send data to the client? How do I know from ...
0 votes
1 answer
63 views

Send a socket with Socket java library

I am trying to open a TCP connection between two machines which are not within the same LAN. the server does not receive anything even though it has opened the port with port forwarding in the router ...
  • 206
0 votes
1 answer
340 views

python socket / how do you detect disconnection from clients and detect number of connections per user

this is for server authentication for my application. (im working on login function so dont mind about it) what i wanna do is to make server receive heartbeat from client and close client socket if ...
1 vote
0 answers
47 views

Stream Read Error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

I am working on a windows service to communicate with servers, In which I am using the TcpListener class. In TcpListener class, after 3 successful socket connections, the 4th connection is returning ...
0 votes
0 answers
49 views

sending data to a Server implemented in other language

i'm having a serializabled object from class called Account. this object must be send from one device to other device using socket programing. the problem is that the Server in written in Python and ...
0 votes
0 answers
28 views

Where can I find the source of command tcpip on android? Is it possible to replicate the behaviour without root?

As I asked here: TCP listening on port (tcpip) without root and usb cable on android < 11 I am trying to listen on a specific port (without root or usb cable) for running commands through adb. ...
0 votes
0 answers
150 views

Java PrintWriter with socket OutputStream waits input when multiple println() in a row

I'm trying to code a very simple client-server application for practicing in Java, but I have a problem with the println() method in server-side; the code looks like this, even thought it's not ...
  • 23
0 votes
0 answers
347 views

How do I connect to another computer with socket ? I get the error ConnectionRefusedError: [Errno 111] Connection refused

I am trying to make a program where I can connect to other computers using sockets in Python. I'm testing it on my Linux machine to see if I can connect to it, but I get this error: ...
0 votes
1 answer
39 views

Handle HTTP POST multipart response through ServerSocket

Good afternoon everyone, First of all, I'll say that it's only for personal purpose in a certain way, it's made to use for little projects to improve my Java knowledge, but my idea is to make this ...
0 votes
0 answers
102 views

flutter ServerSocket unbind tcp

here is my code in statefulWidget Class that i push from main class,the code belove work well the first time ,but when i try to open the second time i receive bad stream , stream was listen to ,so i ...
  • 53
0 votes
0 answers
80 views

Android Java: Proxy-App without Port-Forwarding

I have to create a simple rotating proxy application where 100 requests get evenly distributed to 10 devices. I've got the following structure: WebServer with a Java-SocketServer running. All Android ...

1
2 3 4 5
38