Questions tagged [tcpserver]

A tcp server uses raw tcp sockets to communicate with its client (usually without using a higher level protocol such as HTTP or IMAP).

A TCP server is a server that uses raw tcp sockets for the connection. All HTTP Servers are tcp servers in the end but usually you don't call them tcp servers because they work on a higher level protocol: HTTP.

680 questions
3
votes
2 answers

How to send a "hello" to server and reply a "hi"?

With my code I can read a message on the server and write from the client. But I am not being able to write a response from the server and read in the client. The code on the client var cli = new TcpClient(); cli.Connect("127.0.0.1", 6800); string…
BrunoLM
  • 97,872
  • 84
  • 296
  • 452
3
votes
1 answer

Tornado read until close method error

I am trying to create TCP server in python with a tornado. My handle stream method looks like this, async def handle_stream(self, stream, address): while True: try: stream.read_until_close(streaming_callback=self._on_read) …
Krupa Suthar
  • 670
  • 3
  • 14
3
votes
3 answers

Send sensor data over socket communication (TCP/IP) between Pi's with python

Hello everyone, I have a problemen with some socket communication coding. I have two pi's communicating over TCP/IP with python scripts. The idea is that one pi (client)reads temperature/humidity sensor data and sends it over to the other pi…
Thijs
  • 71
  • 1
  • 2
  • 13
3
votes
1 answer

How to stop TCPServer

On every of three iterations TCPServer needs to be started and then immediately stopped. All three times it needs to be started on port 8000. As it defined in a code below, the TCPServer starts. But it starts only during the first iteration. Two…
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
3
votes
0 answers

Xamarin Forms App as TCP Server

I have a cross-platform Xamarin.Forms app (iOS and Android) which provides a specific service. This service code is in PCL part of the project and I want to use it on web client as well using my app as server. Is there a way to implement TCP server…
Umair M
  • 10,298
  • 6
  • 42
  • 74
3
votes
1 answer

How to find a free TCP Port in windows using 'C'

I would like to have two windows applications which communicate over TCP/IP using windows sockets. In this, I want my program to automatically choose the available free port for connection establishment. Is there a way to find the free TCP port…
Krish
  • 31
  • 1
  • 3
3
votes
1 answer

c# tcpclient program writing to stream but client not receiving data

I have written a TCPClient program to run on my PC. It first initiates a TCP listener to listen on a specific port then reads/writes from/to multiple TCP clients on multiple threads. I am able to read from the client but whenever I try to send data…
Jawad
  • 111
  • 8
3
votes
1 answer

Event Listener in PHP

I want my web server to notify me through a php page when an event occurs at another TCP server, to which the PHP page has successfully connected via a socket. The event is like the TCP server wants to send a message to the web server, etc. Is there…
Izza
  • 2,389
  • 8
  • 38
  • 60
3
votes
2 answers

Connecting to Node.js server on azure virtual machine

I created a virtual machine on Azure and defined a TCP endpoint. I then created a Node.js TCP server as follows: var net = require('net'); var host = '127.0.0.1'; var port = 8000; var times = 1; net.createServer(function (socket)…
Vinu
  • 109
  • 1
  • 14
3
votes
0 answers

QTcpSocket and Specifying Client Outgoing Network Device

Windows 8.1 user here, using Qt 5.3. Trying to learn network programming (please bear with me). Let's say I have two network devices on my machine. One is assigned the IP 192.168.1.2, and the other 192.168.1.3. The first device has priority. My goal…
user657222
3
votes
1 answer

How to test a multi-threaded TCPServer with rspec

I've written a really simple date server: require 'socket' s = TCPServer.new 3939 while (conn = s.accept) Thread.new(conn) do |c| c.print "Enter your name: " name = c.gets.chomp c.puts "Hi #{name}, the date is..." …
ssks
  • 81
  • 5
3
votes
0 answers

Python TCPServer Timout socket timeout handling

I am trying to handle a hard to duplicate error case using TCPServer. We have seen a few occurrences that when a socket timeout happens in the handler, the code never recovers and keeps returning the socket.timeout exception. This looks to be from…
MauriceS
  • 51
  • 4
3
votes
1 answer

How to shut down a Python TCPServer or HTTPServer or SimpleHTTPServer?

I'm putting together a test harness for a C/C++ HTTP/HTTPS client, and I'd like to use python for the server in the test harness. Python seems to have a very nice set of TCP/HTTP server and handler classes and seems like it would be the path of…
Ted Middleton
  • 6,859
  • 10
  • 51
  • 71
3
votes
2 answers

How to send RST manually with a custom server?

I am trying to debug a scenario, and for that I want the http server to close the connection via RST. Right now it is doing a graceful close with fin/ack. Is there any way I can manually send a RST packet to close the connection as part of the…
ahamed101
  • 110
  • 2
  • 9
3
votes
1 answer

CLOSE_WAIT state in server

In one of our server, many connections are in CLOSE_WAIT. I understand that it means the other side of the connection is closed and now it is upto the server to send the FIN and change the state to LAST_ACK and close the connection. My questions…
ahamed101
  • 110
  • 2
  • 9