FAQ Database Discussion Community


C# Multi threaded Server

c#,multithreading,sockets,tcp,server
I have this client and server code. Client: namespace ClientTest { internal class Program { private static TcpClient client; private static NetworkStream stream; private static void Main(string[] args) { string temp; client = new TcpClient("192.168.1.2",5052); stream = client.GetStream(); Console.WriteLine(client.SendBufferSize); while ((temp = Console.ReadLine()) != "exit") { Send(temp); } Thread one=new...

Malformed DNS Request Packet

tcp,dns,wireshark
I've been working on a project which involves sending DNS requests with information (not actual domains) in the questions (2 of them). I've been tracking the packets with wireshark. Here is the tcp dump of the packet created. 00000000 00 02 01 00 00 02 00 00 00 00 00...

TCP Receive in Python, reading the data out

python,oop,tcp,bytestream
My Python script is as below (sensitive data removed where necessary) import socket class TCPConnection: def __init__(self, sock=None): if sock is None: self.sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM) else: self.sock = sock def connect(self, host, port): try: self.sock.connect((host, port)) print('Successful Connection') except: print('Connection Failed') def readlines(self): data = self.sock.recv(1024) print(data) if...

Golang server, how to receive TCP JSON packet?

json,sockets,tcp,go
I'm new to Golang and am using the "Server" code here as a starting point: http://www.golang-book.com/13/index.htm#section7 I've attempted to use JSON instead of Gob decoding (since I am required to write the client in C#), and I'm sending the JSON TCP data client data in a separate script from the...

What is the best approach to make Data Receive / Data Listener keeps alive?

c#,async-await,tcp
I have task to create a client application for data communication via TCP and I have no experience in TCP data communication programming. I use C# and VS2013. In the company I work at there is a black-boxed server application. I only know its ip, port and its behaviors on...

C: Linux to Windows: Sending text file over TCP produces not exact copy on the Windows side

c,linux,windows,sockets,tcp
I'm writing a system to gather software/hardware info on Macs to put it into a Windows-based SQLite3 database. Schema is as following: agent on Mac - gather data, then sends it over Internet, using SSL, to small Linux server in DMZ (this part works as intended so far) Linux server...

How to find the source ip and port of a client that wants to connect to a listening socket?

linux,sockets,tcp,listen
I am using a tcp socket on linux to listen for incoming tcp connections. the socket is blocking type. I would like to find out what client is trying to connect to my socket before calling accept(). More specifically, I want to know the source IP and port. Now, I...

Possible .NET Issue - Exception Thrown in C# Code [duplicate]

tcp,.net,c#,visual-studio-2013
This question already has an answer here: C# network connection running from shared drive 1 answer New Instance of TCPClient Exception [duplicate] 1 answer I was directed to SuperUser from a question I posted on stack overflow. Link to StackOverflow question: New Instance of TCPClient Exception While creating an...

UDP and TCP always use same IP for one client?

python,sockets,networking,tcp,udp
I've made a server (python, twisted) for my online game. Started with TCP, then later added constant updates with UDP (saw a big speed improvement). But now, I need to connect each UDP socket client with each TCP client. I'm doing this by having each client first connect to the...

having spring integration tcpserver to manage clients and send them messages

java,tcp,spring-integration
I have already created a simple tcp server with spring integration which keeps a connection alive and responses to each request during the connection. In that requestMethod, I'm also able to read the MessageHeder to get the connectionId. Now I want to send messages from the server to the client....

How quickly does netstat capture network snapshot?

networking,tcp,netstat
I have a machine where there are a large number of connects and disconnects every second(or even lesser). I need to capture the network snapshot at one instance of time. But I see that netstat takes some time to return the result by then a lot of sockets would get...

Netty TCP push/streaming server

java,tcp,netty
Is it possible to implement request for stream style client server interactions at the tcp level in netty? The protocol would essentially follow: t0: tcp handshake t1: client requests topic X t2-tn: server sends latest enqueued update on topic X I've seen a netty websockets example, but is it possible,...

Writing into a TCP socket from C to Python

python,c,sockets,tcp
I've written a TCP socket in C that connects to port 5678. It is supposed to transmit a String from C to a TCP client written in Python. Here's the server loop written in C: for(;;) { bzero(buffer, 256); // Socket read functions n = read(clientsockfd, buffer, 255); if (n...

How is determining body length by closing connection reliable (RFC 2616 4.4.5)

sockets,http,tcp,rfc2616
I can't get one thing straight. The RFC 2616 in 4.4.5 states that Message Length can be determined "By the server closing the connection.". This implies, that it is valid for a server to respond (e.g. returning a large image) with a response, that has no Content-Length in the header,...

Unity delay in sending the current value when using sockets

c#,sockets,tcp,unity3d,delay
The client.cs in Visual Studio. private void SendToServer(string HeartRate) { SetHRTest(HeartRate); try { s = client.GetStream(); StreamReader sr = new StreamReader(s); StreamWriter sw = new StreamWriter(s); sw.AutoFlush = true; sw.WriteLine(HeartRate); } finally { if(Environment.HasShutdownStarted) { s.Close(); client.Close(); } } } The server.cs in Unity using UnityEngine; using System.Collections; using System.Net.Sockets;...

when does poll() return POLLERR

c,sockets,networking,tcp,polling
server.c -> always recv client data(use poll() to confirm whether an error occurred) client.c -> always send data to server I exec server.c and client.c ,then i try to kill client.c process. But the POLLERR flag never be set. The man page only say POLLERR Error condition (output only) When...

Send a string with sockets in C++ (Winsock TCP/IP)

c++,sockets,tcp
I'd like to send a string with sockets from a client to a server. Here's the code of the client: #include <iostream> #include <winsock.h> #include <unistd.h> using namespace std; int main() { //Load socket WSADATA wsaData; WSAStartup(0x0202, &wsaData); //Create first socket int thisSocket; struct sockaddr_in destination; destination.sin_family = AF_INET; thisSocket...

Configuring client throughput in simple TCP server

python,tcp,server,echo,tcpclient
I was given a sample project which goes like this: Client A connects to server B. A sends packet to B, B returns the same packet to A. Client A sending throughput is configurable Measure turnaround time per packet. Now step 3 is what is confusing me. Using python, the...

Websocket frame, TCP segment: the relationship?

sockets,networking,tcp,websocket
Websocket is high level protocol based on TCP. Websocket has its own frame https://tools.ietf.org/html/rfc6455#section-5.2 TCP also has its own segment: http://en.wikipedia.org/wiki/Transmission_Control_Protocol So, when using Websocket, send data: First, the data is wrapped in Websocket frame, then, the frame is packed in TCP segments, finally, send the TCP segments out. Am...

NIO SocketChannel saying there is no data when there is (or selector is not informing me)

java,sockets,tcp,nio,socketchannel
I have a functioning client-server apparatus which can successfully connect and send messages to each other using NIO. Right now my only confusion is how I'm supposed to continue reading when socketChannel.read() returns zero. I have a protocol that sends the first 4 bytes as the number of incoming bytes...

Datanode and Nodemanager on slave machine are not able to connect to NameNode and ResourceManager on master machine

java,apache,sockets,hadoop,tcp
I have installed hadoop on two node cluster- Node1 and Node2. Node1 is master and Node2 is slave. Node2's datanode and Nodemanager are not able to connect Namenode and Resourcemanager on Node1 respectively. However Node1's datanode and Nodemanager are not able to connect Namenode and Resourcemanager on Node1. Node1: jps...

Can't install TCP Activation on Windows 8.1

.net,wcf,tcp
I'm following a tutorial on WCF. In it, I get the instruction to turn on TCP Activation in the "Turn Windows features on or off" menu. See this screenshot: However, after selecting it and pressing ok, I get this: Googling error code 0x800F0922 yields no results, and no matter how...

TCPIP Asynchronous Server connection dropout

c#,asynchronous,tcp,server
i have written(Copied) code for a tcpip server. We have software that sends a message via TCPIP and expects a return message back to say Receive is Acknowledged. This works fine. But after sending the acknowledgment the connection drops out. I am not sure where in the code this dropout...

how can firewall/iptables check incoming tcp traffic of already bound ports?

sockets,tcp,port,firewall,iptables
As far as i know only one process can be bound to a port of the same protocol, and in order to read incoming information to a port a socket must be bound to a that relevant port. is there a way of sharing a socket with another process or...

0x00 hex over TCP socket in QT

qt,tcp,hex,bytearray
I have problem with sending 0x00 over tcp. Data like 0x01 are ok, server receiving as 00000001, but when is 0x00 - no receive message on serwer. Client code: QByteArray sender="\x00"; socket.write(sender); Server code: QByteArray Data = socket->readAll(); QString str = QString(Data.toHex()); qDebug()<<str; //disp bytes char myByte = Data.at(0); for...

Connecting to Server on One Computer from another with TCP Listener/Sockets

c#,sockets,tcp,network-programming,server
I have a simple server I can run on one computer that a simple chat client can connect to. When I run the server on my local, I can connect to it fine from a client also on the local. The problem is that I can't seem to connect to...

iostream and No_delay option

tcp,boost-asio
I am trying to disable the Nagle Algorithm using the answer for the same question: ASIO ip::tcp::iostream and TCP_NODELAY: boost::asio::ip::tcp::iostream socketStream; const boost::asio::ip::tcp::no_delay option( true ); socketStream.rdbuf()->set_option( option ); boost::asio::io_service io_service; tcp::endpoint endpoint (tcp::v4 (), 6666); tcp::acceptor acceptor (io_service, endpoint); std::cout << "Waiting for connection.." << std::endl; acceptor.accept (*socketStream.rdbuf ());...

Sending files in socket programming tcp

c++,sockets,tcp
I am trying to implement a simple file transfer. Below here is two methods that i have been testing: Method one: sending and receiving without splitting the file. I hard coded the file size for easier testing. sender: send(sock,buffer,107,NULL); //sends a file with 107 size receiver: char * buffer =...

TcpClient- how to connect to an external IP address?

c#,tcp,ip,ip-address,tcpclient
I have been trying to setup a basic scenario where a TcpClient connects to a TcpListener on the same machine, but so far it only works for 127.0.0.1 and 192.168.X.Y. Here is my code: var server = new TcpListener(IPAddress.Any, 51328); server.Start(); var client = new TcpClient(); client.ConnectAsync(IPAddress.Parse("address from whatismyip"), 51328);...

client can't send message from seperate class

android,sockets,tcp,android-studio,client
I created a socket program on android studio. First I create it with on the main class and it is working. With the help of this site I separate the connect and disconnect it works. Now there is a problem when the client send a message on the server. Whenever...

Timeout after 1024 connections from different virtual IPs

python,linux,sockets,tcp,network-programming
I have a problem I have struggled with some time now without solving it. I am implementing a traffic generator which has a client and a server side. The client side simulates devices with unique IP-addresses. These IPs are added as a virtual interface on the client which the simulated...

Need to reassemble tcp packets with netty

java,sockets,tcp,netty
currently I am working with an inhouse protocol where I send a request to our hardware and receive the answer with netty. In the message which I receive are several bytes which tell me how many bytes the answer will contain. In my channelRead method I wait until the readable...

Is it better to reuse connections, or renew them for sending data frequently?

sockets,tcp,network-programming
I have a TCP server application which listens for connections from clients that send "heartbeat" packets frequently in rather small intervals, around 20 seconds. There are a few hundred such clients, 1000 at most. It has previously been implemented (not by me) such that a new TCP connection is established...

Persistent connection not working at all

html,http,tcp,scapy,keep-alive
I am making a webserver with scapy, which is going pretty well. However, it's a pain in the butt for scapy to maintain different connections at the same time. So I want the client to make a persistent connection with the webserver that servers a html page with an image....

Re-transmission concept in TCP

tcp,routing,tcp-ip,osi
Server sent data to client, but client didn't send ACK for the data . So once RTT completed , Server will resend data to client again .... like that how long it will try to send the data ? What is the maximum time server will try to send the...

Tornado behind Nginx, should I use TCP nodelay config in python or nginx.conf?

nginx,tcp,websocket,tornado
I have a Tornado server running behind Nginx reverse proxy. The proxy is configured with tcp_nodelay: on. I see there's also an option to call WebSocketHandler.set_nodelay(True) on a WebSocket instance once it's connected. Do these two create the same effect? Are there pro's con's for using one over the other?...

Idomatic way to timeout TCP handshake in Go

tcp,go,timeout
What is the idiomatic way in Go to timeout a TCP conversation, such as intial protocol handshake? Let's say there is a goroutine that handles the TCP conversation. I can launch it, then launch a time.After(), then select for both of them and if timeout was hit, proceed on doing...

Unable to ssh into remote Linux by ngrok

linux,ssh,tcp,ngrok
The remote Linux is in an internal network and has no public IP address. So I installed ngrok. ngrok tcp 22 ngrok by @inconshreveable (Ctrl+C to quit) Tunnel Status online Version 2.0.19/2.0.17 Web Interface http://127.0.0.1:4040 Forwarding tcp://0.tcp.ngrok.io:36428 -> localhost:22 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00...

Java TCP-Sockets transmit files larger than 4gb

java,sockets,tcp
I am trying to transfer a file that is greater than 4gb using the Java SocketsAPI. I am already reading it via InputStreams and writing it via OutputStreams. However, analyzing the transmitted packets in Wireshark, I realise that the Sequence number of the TCP-packets is incremented by the byte-length of...

How does one test net.Conn in unit tests in Golang?

unit-testing,testing,tcp,go
I'm currently looking into creating some unit tests for net.Conn interface in Go, as well as other functions that build up on top of that functionality, and I'm wondering what is the best way to unit test that in Google Go? My code looks like: conn, _:=net.Dial("tcp", "127.0.0.1:8080") ... fmt.Fprintf(conn,...

Tcp Port connection shows incompatible value

c#,tcp,port,tcpclient,tcplistener
Consider the following code: void Connect(IPAddress address, int port) { TcpListener listener = new TcpListener(address, port); listener.Start(); TcpClient client= new TcpClient(); //The following line would actually block the caller, but ignore this fact ATM. var conn= listener.AcceptTcpClient(); client.Connect(address,port); var address = ((IPEndPoint)conn.Client.RemoteEndPoint).Address; var port = ((IPEndPoint)conn.Client.RemoteEndPoint).Port; } The port number...

java.net.ConnectException: Connection refused TCP

java,android,tcp
Objective - I want to send the entered text in the java (PC) project to the android app which displays this text.The PC is connected to wifi hotspot created by the android mobile. The PC/client java project code: public class EcsDemo { public static void main(String[] args) { System.out.println("Enter...

Nodejs TCP connection client port assignment

node.js,tcp
I created tcp connection between client and server using nodejs (net module). Server is listening on already predefined port and client is connecting to that port. As far as i understand port for client is dynamically assigned by node? Is that correct? What kind of algorithm node is using to...

Ways to detect TCP connection resets

java,sockets,tcp,java-8
I have made a small telnet-like application, and currently the only way i know if two sockets cannot communicate is when a SocketException is thrown with the message "Connection reset" (when i poll for input). It doesn't produce a problem in my application however, since i can catch the exception,...

Node JS TCP Proxy: Set up HTTP Tunnel using Node JS

node.js,networking,tcp,proxy,http-tunneling
I'm trying to implement a TCP proxy in Node JS. I only have some experience with Javascript so I met a lot of problems along the way. I've done a lot of searching for this one but had no luck. I want to implement a two-hop TCP connection for HTTPS...

TCP Three way handshake - Piggybacking ACKs

networking,tcp,protocols,handshake
I understand that in the three-way handshake, sometimes the receiving end will send a SYNACK packet when establishing a connection (piggybacking), but when would it ever send a SYN and then an ACK packet? For example: ->SYN <-SYN_ACK ->ACK versus: ->SYN <-SYN ->SYN_ACK Thanks!...

How will a c# tcp socket block if I send too many bytes?

c#,sockets,tcp
I am writing a tcp server which needs to send data to connected remote hosts. I'd prefer socket send calls to not block at all, ever. To facilitate this I am using Socket.Select to identify writable sockets and writing to those sockets using Socket.Send. The Socket.Select msdn article states: If...

Where is IANA (port numbers registry) saved?

tcp,iana
I was wondering where can I access the IANA registry? Is it implemented in the OS? How do applications know which port to connect to, to be exact where to compare the port numbers? Some apps have the port numbers hardcoded and some have you input it, but where exactly...

how TCP segments can be misrouted

networking,tcp,ip,tcp-ip
I am just wondering, how the TCP segments can be mis-routed, isn't the original source and the ultimate destination in the IP header never get touched!

psuedo TCP multicast with os.dup2() in python?

python,sockets,tcp,multicast,dup2
The idea is to multicast the same content from one single resource to multiple receivers at once. I came up with the following code: #!/usr/bin/env python # coding: utf8 import socket, os c = socket.socket() c.connect(('127.1', 4343)) s = socket.socket() s.bind(('127.1', 8989)) s.listen(3) while 1: conn, addr = s.accept() print...

What could cause a Java TCP socket to close?

java,sockets,tcp
I'm trying to use an implementation of an MQTT client specifically Paho Java client in Android, and trying to trace where I get an EOFException error. Specifically this happens on in.readByte();. public final byte readByte() throws IOException { int temp = in.read(); if (temp < 0) { throw new EOFException();...

boost asio TCP server must bind to an IP address?

c++,boost,tcp,boost-asio
I am not sure whether I am using BOOST ASIO properly, my code is as follows, boost::asio::ip::tcp::resolver resolver(io_); boost::asio::ip::tcp::resolver::query query(std::string("127.0.0.1"), port); boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); acceptor_.open(endpoint.protocol()); It binds to 127.0.0.1. When a client is connecting externally, the client is using the IP address 192.168.0.107 or something similar. The server implemented...

Trying to create a server that will receive more than 1 file, but it always stops after receiving 1 file

c#,sockets,tcp,tcpclient,tcpserver
Im trying to create a server that will receive files from clients, right now its working but not the way i want it to. the way i wanted it to work is: 1. Start server 2. Receive file from client #1 3. Send some other file back to client #1...

C# tcp socket (networkstream.read won't work with 8.1)

c#,sockets,tcp
I've got a program that runs a tcp socket. It runs fine on anything below windows 8.1. I've already turned off my firewall and have set everything to allow this connection. 1.First the server does run on windows 8.1 2.The client socket does connect. 3.The client sends a string "login",...

TcpClient still connected after server closed connection. Why?

c#,tcp,connection,tcpclient
I have a TCP server running serving TCP clients - crazy, I know. Now I have a behavior that is not clear to me and maybe someone could help me understanding it. [Test] [TestCase(2, 1)] // first scenario: Okay! [TestCase(1, 1)] // second scenario: Huh? public void NotifyClientAboutError(int clientSendBytes, int...

C++ overload << operator for class object acting as stream

c++,sockets,tcp,operators
So I've browsed a bunch of other threads, but none pertain to the questions I have on this exact topic. I am writing a C++ library to do socket communication. I have a TCP socket class which handles all operations on a TCP socket (setup, read/write, etc). I want to...

Data is corrupted after sending from PHP to JAVA using tcp

java,php,sockets,tcp
I am trying to send data from PHP TCP server to JAVA TCP client. I am comparing my results by comparing hex values of the data. PHP script reads STDIN, sends it through socket one byte at a time and java reads it using DataInputStream.read(), converts to hex and displays....

Communicating between a PC and UR5 Universal Robotics Robot Arm using TCP/IP LabVIEW

sockets,networking,tcp,labview,robotics
I have a UR5 Universal Robotics Robot Arm and PC connected via ethernet that I am attempting to have talk to each other via LabVIEW (just send strings back and forth). I have already managed to read communication from the robot to the PC using the TCP Listen VI and...

Wrong byte accepted by tcp sending

java,c#,eclipse,tcp
I have an app in eclipse that was written in java and an app in visual studio that is written in C#. I have a tcp connection between them. My project sends an ID message. The message sending worked fine until now. It shows me in Visual Studio that it's...

Hosting a WCF service using net.tcp binding in IIS 7 (unreachable from outside)

c#,.net,wcf,iis,tcp
I have developped a WCF duplex service and a Windows Winforms client communicating togeteher via a net.tcp duplex binding. Both do communicate and work fine on my LAN, the WCF service beeing hosted on a IIS 7 on a Windows 8 workstation. I then tried to host the WCF service...

I have a server application that gets data exactly half the time. Why/how does this happen and how do I fix it?

c#,tcp,server,packet-loss
So my server and chat client are made from 2 different C# TCP tutorials.You may recognize 1 if not both of them and I have made my own modifications to them to fit my own style. When I tried both they worked perfectly fine with 0 loss, but my version...

C++ Winsock programming, receiving no response from HTTP protocol

c++,sockets,http,tcp,ip
As the title says, I've just began studying how the TCP/IP protocol applies to C++, so I tried sending a packet to any random website (In this case www.nasa.gov), using the IP address (DNS Resolver) and a random port (I went for 80), and I am receiving no answer. I...

Sending double with tcp from java to C#

java,c#,.net,sockets,tcp
I have a Java SocketServer that sends doubles to a C# client. The sever sends the doubles with DataOutputStream.writeDouble() and the client reads the double with BinaryReader.ReadDouble(). When I send dos.writeDouble(0.123456789); and flush it from the server the client reads and outputs 3.1463026401691E+151 which is different from what I sent....

How does netstat determine symbolic hostname?

linux,unix,networking,tcp,netstat
I was trying to understand what the --numeric/-n flag of netstat does? Manual says the following about --numeric/-n --numeric , -n Show numerical addresses instead of trying to determine symbolic host, port or user names. Following is a line of output with "-n" option tcp 0 0 :::8080 :::* LISTEN...

TCP server not receiving all data being sent

c#,xml,tcp,server,tcpserver
Attempting to setup a TCP server to grab data from a stream. Seems to be working, but only when the stream is small. Once I start sending large amounts of data, this fails, only returns a portion of the characters. Can anyone help me out here? Why am I only...

Using TCP in Standard ML

sockets,tcp,sml
I'm trying to write a minimal TCP server in Standard ML and getting some type errors I don't understand. What I've got so far is fun sendHello sock = let val res = "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello world!\r\n\r\n" val wds = map (fn c => Word8.fromInt (Char.ord c)) (String.explode res)...

segmentation fault in linux (socket programming (TCP) in C)

c,linux,sockets,tcp,segmentation-fault
I am just learning socket programming on Linux by some websites and here are some parts of my code on server side by using TCP: #define BufferLength 100 #define SERVPORT 3111 int main() { /* Variable and structure definitions. */ int sd, sd2, rc, length = sizeof(int); int totalcnt =...

Logback TCP syslog conforming RFC 5424

logging,tcp,logback,syslog
I'm trying, with logback, to send logging messages in a remote syslog, using TCP, and conforming to RFC 5424. As far as I understand, logback default's syslog appender only handles UDP. So far I've found a logback-syslog4j library on github which handles TCP. But it doesn't seem configurable enough to...

How will a socket act when the data is sent faster than it can be processed?

sockets,networking,tcp,network-programming,flow-control
I am not quite clear some detail mechanisms of TCP and sockets. One client connects to a server through TCP, and sends data to server. What happens if the speed of sending is far greater than the speed of processing? For example, if the client sends 1MiB per second, but...

How is Ctrl+C key behaves in a TCP connection

sockets,tcp,control-c
I'm studying network and specifically tcp connection and i wondering in a situation that you connect remotely to a server using tcp connection and sending command line to execute some actions, How they handle sending a ctrl+c signals? Is it sends a normal tcp package that in data section describes...

Continuous data stream from linux command line into python script

python,linux,command-line,tcp,pipe
I need to get a continuous stream of data flowing from a peripheral device, to a raspberry pi, and lastly to my computer (mac). So far, the data is can make its way continuously (in real time) from the peripheral, to the command line of my raspberry pi. Note that...

How do I run a simultaneous scan in nmap?

networking,tcp,nmap
I am trying to run a simultaneous nmap scan to do the following http://i.stack.imgur.com/7skvt.png I have divided what I need to do into 2 parts nmap -sN -p 21-25,80,139,8080 nmap -T 5 -sU -p 53,11 thevictim.com/16 How do I run them as a simultaneous scan? Also, are my above commands...

String is not adding to itself properly. But is able to compare

c#,xml,string,loops,tcp
string returndata = ""; string FullResponce = ""; bool RecieveAgain = true; while (RecieveAgain == true) { byte[] inStream = new byte[clientSocket.ReceiveBufferSize]; serverStream.Read(inStream, 0, inStream.Length); returndata = System.Text.Encoding.ASCII.GetString(inStream); FullResponce += returndata; if (FullResponce.Contains("< /Program>")) { RecieveAgain = false; } } xmlDoc.LoadXml(FullResponce); This is a loop to continue retrieving data until...

TCP Window size field, does it refer to sender or receiver of segment?

tcp
As I understand since TCP is connection-oriented there really isn't a single sender and receiver, there is two pipes, each node acts as both sender and receiver. This bring some confusion when Window size is referred to as the available buffer at the receiving side. So finally, when I observe...

Is it possible to make two SOCKSv4a session connections over one TCP connection?

sockets,tcp,proxy,protocols,socks
I'm trying to create multiple tunnels out of a single TCP connection to a SOCKSv4a proxy server in order to keep from closing and reopening a bunch of sockets to the SOCKS proxy. Something like "Connection: keep-alive". How can I do that? Does the protocol allow it?...

TCP Window Update Scenarios

networking,tcp,webserver
In our application, we are using apache tomcat webserver running in 8081. It receives POST message from Client at 16:42:06.87 IST timeframe. It acknowledges by ACK packet with window size of 62356 bytes after 200ms. After some seconds (3-5 seconds), it also sends similar ACK packet but as a "TCP...

During TCP send breakpoint influences outcome

c#,tcp,sendfile
I have a problem with the Client/Server application i'm writing. It's aim is to send a specific directory's files in the Client and send them to a directory on the Server. I get the files with a foreach, but when i put a breakpoint at the begin of the foreach...

What ip/port should i use for TCP Socket Server/Client connection?

c#,sockets,tcp,server,tcp-ip
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 different machines in same network(both connected to same modem). Which ip port should i use? I need...

Use socket recv function for reading the stream on stdin

c++,c,sockets,tcp
Can I use socket recv function for reading the input stream of stdin. i.e for reading the Ctrl-C. Like. int dummy; ssize_t bytes = recv (0 /* file descriptor for stdin*/ , &dummy, 1, MSG_PEEK); if (bytes > 0 && dummy == 0x03) return true; // Ctrl-C receive else return...

Flush the buffer after receiving packets [duplicate]

c#,sockets,tcp
This question already has an answer here: Socket tcp c# how to clear input buffer? 1 answer I am using the below code for receiving TCP packets from a tool. while(socket.Connected) { var buffer = new byte[4096]; int receiveLength = socket.Receive(buffer); if (receiveLength != 0) { byte[] response= new...

Trying to make a android TCP Server App

java,android,sockets,tcp
I'm Trying to make a android TCP Server App which can get messages from my arduino board through wifi-shield. I am newbie in java coding, so i downloaded the code from http://www.roman10.net/android-tcp-client-and-server-communication-programmingillustrated-with-example/ But it seems it doesnt work. It doesnt have any errors, but when I run it, it just...

akka.io receive line by line in 2.3

scala,tcp,akka
I'm using Akka 2.3 (since that's the version which comes with Play) and want to connect to some TCP socket. I'm aware of the akka.io package. However I can't see any way to process the received data as UTF-8 string line by line (against just receiving byte chunks). Searching the...

How do i create several persistent socket connection TCP/IP to the same host using PHP

php,sockets,tcp
Currently my situation is i have a window server hosting web and will communicate to unix host server(database) to retrieve data whenever user request. I'm using apache and PHP for my window server. Can i actually create a new persistent socket connection to host whenever a new user log in...

How to understand a packet is TCP CLOSE packet with sharPcap

c#,tcp,sharppcap
I am trying to read packets that are sent from the clients to the server. I am using sharpPcap in C#. How can i understand a packet is TCP CLOSE packet in this event: private static void device_OnPacketArrival(object sender, CaptureEventArgs e) { var time = e.Packet.Timeval.Date; var len = e.Packet.Data.Length;...

Smack 4.1 Android anonymous registration to Openfire

android,tcp,xmpp,openfire,smack
I want connect anonymously to openfire server with Android Smack 4.1 client and register the new user (username = "wq", password="wq") with AccountManager, and then disconnect and login as non-anonymous registered user. 3.1.1 Registration with a Server Special care must be taken when an unregistered entity interacts with a server...

Can you have a TCP client without threading

c#,multithreading,tcp
Normally I wouldn't want to try this but I am making a custom unity server and unity is having problems with multithreading and does not allow you to use any unity functionality and says this must be called from the main thread. So my question is, is it possible to...

C - Write File Contents to a Buffer

c,file,sockets,tcp,client
I'm trying to open a file then send the contents to a TCP server. Currently, I am just opening the file and sending the data to a buffer, which will be accessed by the server. I am unsure of how to do this and also how to keep track of...

Bind SqlConnection to local IP End Point?

c#,.net,sockets,tcp,sqlconnection
Assuming you specify TCP protocol, is it possible to bind your SqlConnection to a local IP end point in the same way that you would a socket? (Is there an underlying socket for a TCP SqlConnection that I can access somehow?) The goal is to force the connection to be...

Asyncio persisent client protocol class using queue

python,tcp,python-asyncio
I'm trying to get my head around the Python 3 asyncio module, in particular using the transport/protocol API. I want to create a publish/subscribe pattern, and use the asyncio.Protocol class to create my client and server. At the moment I've got the server up and running, and listening for incoming...

How to secure tcp connection - nodejs?

javascript,node.js,events,authentication,tcp
I have following sample code used in the tcp server var server = net.createServer(); server.on('connection', function (socket) { if(restrictedIP == sock.remoteAddress){ //How to close the particular connection safely without //affecting other connections } socket.on('data', function(data) { console.log(data); }); socket.on('close', function(data) { console.log('client disconnected'); }); }); server.listen(3000, '127.0.0.1'); Note : I...

how should a message look like to be a response

java,tcp,spring-integration
I have read and followed the example in http://docs.spring.io/spring-integration/reference/html/ip.html#ip-correlation I have a spring-integration server <int-ip:tcp-connection-factory id="socketserver" type="server" port="30124" using-nio="true" mapper="mapper" deserializer="jsonSerializer" serializer="jsonSerializer" single-use="false"/> with this mapper from above link: <bean id="mapper" class="org.springframework.integration.ip.tcp.connection.MessageConvertingTcpMessageMapper"> <constructor-arg...

Is it possible to create TCP Private Network communication on WP8.1?

tcp,windows-phone-8.1
I want to make a simple TCP client using WP8.1 that can send some string to Windows 8 doesktop IN THE SAME LOCAL NETWORK. But when i see this documentation : https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj150599.aspx they said " On Windows Phone, there is only one network capability (Internet (Client & Server))which enables all...

app get stuck at serverSocket.accept() and gives bind exception address already in use on the second call for the thread

java,android,sockets,tcp,udp
I have two problems with an app that i have built for socket communication, first I'll try to explain what the app does and then I'll go into the details of those two problems. First I click on a button, which starts a thread, which sends a multicast massage "group...

Need help clarifying TCP ports

sockets,tcp,ip,tcp-ip,ports
Researching about ports online, I have found it being described in many different ways. The main way is that a port is a like a door on your computer used by a specific process. A second way it is commonly explained is that it is just a tag, an extra...

asyncio start_server timeout issue

python,python-3.x,tcp,python-asyncio
I have a TCP server implemented in Python using asyncio's create_server. I call the coroutine start_server with a connection_handler_cb. Now my question is this: let's say my connection_handler_cb looks something like this: def connection_handler_cb(reader, writer): while True: yield from reader.read() --do some computation-- I know that only the yield from...

Self Signed Certificate: connection timeouts

sockets,google-chrome,tcp,network-programming
I have a web application (Apache 2.4 on Centos 7 server) that has limited user access and I am using Self Signed Certificate with Client Certificates (mutual authentication) for each user. Everything works great; users are authenticated successfully, Chrome shows green https in the address bar since I added certs...

Detecting a TCP reset with Linux sockets

c,linux,sockets,tcp
When one end of a TCP link disconnects, it sends a reset (RST) message to the other end. I want to be able to receive this in the application layer. In my code, I use a select() call to receive input from potentially multiple sources, including a TCP connection. I've...

When BSD socket reports that RST was received, if not everything was read yet

c,sockets,tcp
Lets imagine the following data sequence that was sent from the server to the client: [data] [data] [data] [FIN] [RST] And lets imagine that I'm doing the following on the client side (sockets are non-blocking): char buf[sizeof(data)]; for (;;) { rlen = recv(..., buf, sizeof(buf), ...); rerr = errno; slen...

Reopen Tcp socket on the same port

c#,sockets,tcp,tcpclient
I have a socket that serves a single request-response purpose. I set it up on port XXX let it wait for a connection, read the data and reply with some data. I would like to open a new socket on the same port. As soon as the response was sent....

AngularJS app with many files, stalled due max TCP requests

javascript,html,angularjs,google-chrome,tcp
I built an AngularJS app consisting of many js files. Chrome only allows for 6 TCP connections at the time so the other requests are stalled until the first 6 finish resulting in very long compound loading times. How do I change the app so the TCP requests are not...