All Questions
655
questions
58
votes
1
answer
165k
views
What does "app.run(host='0.0.0.0') " mean in Flask [duplicate]
I am reading the Flask documentation. I was told that with app.run(host='0.0.0.0'), I could make the server publicly available.
What does it mean ? How can I visit the server in another computer (...
19
votes
3
answers
142k
views
Python, How to Send data over TCP
I need to create a simple server that listens for TCP connections.
If it receives text on<EOF> or off<EOF> then it sends (echo) back success. The receiving part is working, but now i need ...
15
votes
2
answers
24k
views
How to close socket connection on Ctrl-C in a python programme
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
any_connection = False
while True:
try:
conn, addr = s.accept()
data = conn.recv(1024)
...
12
votes
3
answers
13k
views
How to properly close a Node.js TCP server?
I couldn't find a clear answer on Google or SO.
I know a net.Server instance has a close method that doesn't allow any more clients in. But it doesn't disconnect clients already connected. How can I ...
9
votes
2
answers
1k
views
C TCP sockets, echo server with file sending, hangs up after sending a file
I wanted to write a simple TCP echo server application. I managed to do the echo part, but have some problems with sending files between client and server. The idea is simple: despite sending ordinary ...
8
votes
1
answer
8k
views
Webrtc media over tcp?
I am new to WebRTC.
I was learned about the turn server.
The below thing is used to configure the turn server works on TCP for a webrtc application.
Example turn server configuration in webrtc ...
8
votes
2
answers
14k
views
How to close netcat connection after receive a server response?
I need to sendo a lot of messages via netcat or something similar. The problem is that when I run echo "something" | netcat ip port the connection continues opened after I received the response. ...
8
votes
1
answer
2k
views
Julia TCP server and connection
I asked how to make TCP server that send data all the time in here: Julia TCP select and it works great. I now I have new problem, so I thought to start new conversation.
I did this kind of connection ...
8
votes
1
answer
2k
views
PHP TCP socket connection Limit - Windows server
I have a weird issue and I can't seem to find a solution or anything closer to the issue I am having ,
Here is the thing , I have a scoket script run via php on command line, it accepts connection ...
6
votes
1
answer
8k
views
How to set the socket option SO_REUSEPORT in Rust?
I've read the documentation for std::net and mio, and I've found some methods like set_nodelay and set_keepalive, but I haven't found a way to set other socket options like SO_REUSEPORT and ...
5
votes
2
answers
19k
views
specifying source IP-address for socket.connect() in python sockets
how do we set the source IP-address when we do __socket.connect((host, port)) on a machine that have a several ethernet interfaces?
5
votes
2
answers
7k
views
Microsofts Asynchronous Server Socket Example
I have a question regarding this question ("Asynchronous server socket multiple clients").
Either Microsoft changed the example since Groos answer or I really don't get it -
in the example it says:
...
5
votes
2
answers
8k
views
TCP Server not receiving anything after initial connection. Python
So, I've been experimenting with Python's socket module and I've created a simple TCP client/server setup. Everything's running on the same system (Win7x64), on the ip 192.168.1.3
Here's the client (...
5
votes
0
answers
5k
views
why the turn server does not support for the tcp connection?
I am new to WebRTC.
I need to configure my own turn server for my webrtc application.
I was installed my turn server using the below command.
apt-get install coturn
I need to run the turn server ...
4
votes
2
answers
28k
views
What is the theoretical maximum number of open TCP connections allowed on a Windows server [closed]
On my Windows server I have a port open listening to incoming TCP connections from multiple clients. Is there a limit to the number of unique clients that can concurrently establish a socket ...
4
votes
1
answer
3k
views
TCP socket server how to tell when data received from client is complete?
I'm playing with some asynchronous TCP socket server code that I found at MSDN and I'm unclear on how to detect that I've received all the data that a client is supposed to send. In the MSDN example, ...
4
votes
1
answer
11k
views
Multi-client chat program, broadcasting chat to all clients?
I'm trying to make a very simple chat program that can accommodate multiple clients. I have a multi-threaded server and can connect multiple clients to it, but the server only communicates with a ...
4
votes
1
answer
6k
views
Polling TCP connections in C
I'm working on a school task where i have to make a server that gets TCP connections. Those connections then pass data. I use poll() to see if there is a new connection request or if there is incoming ...
4
votes
4
answers
1k
views
How to get an instance of an existing server in Node.js?
I'd like to get the number of connections of a few servers running on my local machine.
I've successfully used server.getConnections() on a server created via net.createServer(), however I don't know ...
4
votes
0
answers
695
views
Where to find the TCP data (under HTTP) inside Linux kernel?
I'm trying to read the data from HTTP stream with TCP inside Linux kernel. I'm able to get most data from skb_buff here. However, if the server pushes data to the client without requests, the data won'...
3
votes
1
answer
1k
views
socket binding won't return an int
A snippet of my code looks as follows:
int descriptor = socket(AF_INET, SOCK_STREAM, 0);
if(descriptor < 0){
cerr << "Error establishing socket connection." << endl;
return -1;
...
3
votes
3
answers
10k
views
Basic tcp/ip server in swift
I've been trying to write a simple TCP/IP server in swift but I couldn't come up with a solution. I've already tried searching on both here and the rest of the web but I couldn't find something that ...
3
votes
1
answer
14k
views
IIS listen only 127.0.0.1 instead 0.0.0.0
I configure binding on my IIS 7 server like:
ip address: All Unassigned
port: 8080
but in netstat -aon command see only 127.0.0.1:8080 instead 0.0.0.0:8080(which I would like)
Do you know how to ...
3
votes
2
answers
8k
views
Why can't I connect to my server using my public IP?
I have a server program and a client program. While developing the program I run the server and the client on the same machine for convenience. The server starts listening to incoming connections ...
3
votes
1
answer
9k
views
What does the parameter of 1 mean in `listen(1)` method of socket module in python?
What does the parameter of 1 mean in the listen(1) method of socket. I am using the socket module in python 2.7 and I have created a basic server that I want to connect to multiple clients (all on a ...
3
votes
1
answer
15k
views
Python ssl socket server SSLV3_ALERT_CERTIFICATE_UNKNOWN issue
I am writing a python socket server with ssl and I am encountering certificate unknown error during ssl handshake.
I have created private key and certificate with openssl req -x509 -newkey rsa:4096 -...
3
votes
1
answer
634
views
Making pynng and socket talk to each other
TL;DR
I spin up a server using pynng, then a client from Python Standard Library socket will try to send messages to it.
The problem is that client can send the message, but server is oblivious to it. ...
3
votes
5
answers
8k
views
golang http server http.ListenAndServe only works for localhost?
I tied to implement an HTTP server in Azure Linux VM using golang. Below is the simple golang server code, listening on port 30175. And there is no firewall on that port.
package main
import (
"...
3
votes
1
answer
37k
views
Lua TCP/IP simple Client Server connection
I'm looking for a simple client-server connection in Lua. Due to bad online documentation I'm quite helpless. I found two threads here in stackoverflow but they didn't help much. Here is what I have ...
3
votes
2
answers
9k
views
Ruby on Rails: Failed to open TCP connection
I'm using Nokogiri and I'm receiving this error
Failed to open TCP connection to 127.0.0.1:41585 (Connection refused - connect(2) for "127.0.0.1" port 41585)
on this line of the code
doc = Nokogiri:...
3
votes
0
answers
114
views
Is this system an optimal solution to sync an app with a server in real time efficiently?
Problem
I have an Android and iOS app, looking like a classic social network. I need to update UI in real time. Currently, I use a classic system of a client polling each second to a php script by ...
3
votes
0
answers
1k
views
Rust TCP Proxy to pipe http, ssh and other tcp traffic
I am new to rust and as learning project I want to create a tcp proxy. Tokio overwhelmed me and I could not find the proper documentation to understand how it works. So I tried to go with std net ...
3
votes
3
answers
495
views
How to let user download file while it's being generated
I want to let the user start downloading a file when it's not ready yet. I don't want to send user to some page saying "Wait 30 seconds, file is being prepared." I can't generate the file in advance. ...
3
votes
0
answers
2k
views
Many 'cD' flag in haproxy log and many non-zero Send-Q connections. How to debug it?
I use haproxy as tcp balancer for my servers. There are a few hundred non-zero Send-Q connections between haproxy and clients. And there are many 'cD' flag in haproxy log. Now many server responses ...
3
votes
0
answers
321
views
Java server < 50 microseconds TCP latency possible?
Is it possible to create a Java TCP server with latency lower then 50 microseconds?
I tried both vanilla Java and Netty. The best I achieved is ~300 microseconds measuring by both Java System....
2
votes
2
answers
2k
views
Can someone interpret these apache bench results, is there something that stands out?
Below is a apache bench run for 10K requests with 50 concurrent threads.
I need help understanding the results, does anything stand out in the results that might be pointing to something blocking and ...
2
votes
1
answer
2k
views
Detect when TCP is congested python twisted socket server
I'm working on a realtime MMO game, and have a working TCP server (along with game client), but now I'm considering using UDP for constantly updating other player's postions(to greatly reduce random ...
2
votes
2
answers
291
views
TCP sockets, send files, client server, server doest save a whole file, C language
I wrote a simple protocol in which Im able to exchange files / text messages between client and server. If the client send a text to server, server should simply echo it back. On the other hand, when ...
2
votes
1
answer
3k
views
Apache NiFi TCP Client/Server
Can I simulate a TCP client/server interaction using Apache NiFi processors alone or do I have to write code for this? The processors to be considered here are ListenTCP, PutTCP, and GetTCP. In ...
2
votes
2
answers
1k
views
Slow accept() in socket server in C
I have the following code for my education socket server in C.
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types....
2
votes
2
answers
17k
views
c# service to listen to a port
I believe what I am looking to create is a service that listens to a specific port, and when data is sent to that port, it sends off that data to another script for processing.
For some reason though,...
2
votes
1
answer
50
views
"Bus error: 10" When attempting to read IPv4 address from C program arguments
I'm making a TCP server and client, and as part of the server program it needs to take an IPv4 address and port number as arguments at the function call.
#include <stdio.h>
#include <stdlib.h&...
2
votes
1
answer
146
views
Rust server must save the updated value of variable
I need to realize TCP server, that stores a variable M. At the beginning, M = 1.
But, when the conntection set between server and client, and client sends another value of variable N, server must do ...
2
votes
2
answers
1k
views
Simultaneous use of TCP and UDP sockets
I have created a simple server that currently uses a TCP socket for all my packeting needs. If some data transfer is best used with TCP and others with UDP, what is the most effective way to use them ...
2
votes
1
answer
185
views
How to know when to stop data tunneling in HTTP proxy connection
I am trying to write my own HTTP proxy server and I have a question about the protocol.
First, I would like to mention that I am using this page as a reference. I think it's accurate but it's also ...
2
votes
2
answers
9k
views
Tomcat behavior for CLOSE_WAIT connections
The acceptCount queue is maintained at OS level. Lets say we have a acceptCount queue of 10K.
Situation - The server is unable to process the request or is taking a long time due to one of the ...
2
votes
1
answer
519
views
64k connection myth and NAT translation
I have a lot (ten of thousands) of connected mobile devices which are maintaining an opened connection to a server. If my understanding of the 64k connection limitation is correct, you cannot have ...
2
votes
1
answer
2k
views
Scala - TCP Packet frame using Akka
Is there any way in Akka to achieve packet frame just like in Erlang with {packet,4}?
Packet looks something like this:
4 bytes length in big endian | body...
For example:
00 00 00 05 H E L L O 0 ...
2
votes
2
answers
3k
views
What ip/port should i use for TCP Socket Server/Client connection?
i made basic TCP Socket server and client console application in c# with listener etc.. it works well with both server and client executed in same machine(127.0.0.1:10048). I want to try it with ...
2
votes
2
answers
11k
views
How to find IP:Port of incoming client in TCP Connection
After receiving a connection from conn, err := listener.Accept(), I want to find the address of the client at the other end of the conn. I've tried doing this with conn.LocalAddr() and conn....