tcp

How to save data in TCP socket connection session?

Hello all, I want to code a server in java which will accept the information from many devices and store the information in database. The devices will keep sending the packets. The first packet will contain the unique deviceId, and after that only data related to the device. I want to save data along with deviceId. Up to now, I could dev...

C#: Unable to receive large data on TCP Server

hi. I have created a TCP server. I am facing one problem. my TCP Server is not receiving data larger than 30000 bytes. here is code to receive data MAX_TCP_DATA = 64000 private void Process() { if (client.Connected == true) { log.InfoFormat("Client connected :: {0}", client.Client.Remot...

Multiple communication channels with Twisted Python

I am currently researching the Twisted framework as a way of implementing a network-based backup application, and I would like to achieve something that I cannot find any examples of on the net. I plan to implement the system using the Perspective Broker, but I will also need a way of transferring binary files from the client to the ser...

How do I re-route network traffic using Python?

Small apps like Freedom and Anti-social have created quite a stir lately. They cut you off from the internet either entirely or just block social networking sites in order to discourage procrastination and help you exert self control when you really want to get some work done. I looked at the available options and also at some Google Ch...

Realtime TCP/IP Socket Server on Amazon EC2

Hello everyone, I am planning to move a game server of mine to Amazon EC2. Right now the actual server runs on .Net Framework 3.5 on a windows dedicated server. Since it is a personal side-project, it's quite expensive to have a fully dedicated server to that, therefore I would like to move it to the cloud (Amazon EC2 or maybe Windows A...

Persistent TCP connections, long timeouts, and IP hopping mobile devices

We have an app with a long polling scheme over HTTP (although this question could apply to any TCP-based protocol). Our timeout is fairly high, 30 minutes or so. What we see sometimes is mobile devices hop from IP to IP fairly often, every minute or so, and this causes dozens of long-lived sockets to pile up on the server. Can't help bu...

bypass silverlight tcp port restrictions

Hi, Is there a way to bypass the Silverlight port range (4502-4532) security restriction for TCP connections? Maybe a 3rd party implementation of TcpSocket that does not enforce the 4502-4532 port range? ...

Java netty server getting timed out from client connection

We have a netty server running on a specific tcp port. Once in a while, we are getting time out from client connection at this port. But already connected clients have no problem transferring data in the mean time. What could be the problem and what steps can we take to troubleshoot this? The server has very low cpu/ram usage so I don't ...

TcpClient sometimes needs to wait a few hundred milliseconds to be able to send

Hello everybody. I've got quite a weird problem. I'm writing a wrapper for TcpClient to send and receive HTTP requests. The main reason I don't use the built-in WebRequest is because I need a support for SOCKS proxies, and WebRequest does not support it. Anyway, in one of my tests(That use no proxy, just ordinary TcpClient), I've got a...

Odd Behaviour with Lines in TextBox and .AppendText() - C#

Hello all! I'm currently following the great tutorial on Geekpedia to create my own Chat Client and Chat Server. Connecting the clients to the server works fine but I'm experiencing a few issues with the text being displayed in the chat log. The first message that is displayed is in the Server window then the incoming connections are ...

What are best practices of designing and implementing Network Protocols?

For the first time I'm trying to implement some Network Protocol over TCP/IP. I've designed one but I'm not sure if it's efficient. Design So here is my idea: after client opening TCP/IP connection with server, every time it wants to make request, first of all it sends size of request followed by some separator character (new line or s...

c# TCP/IP server and client

I want to write a similar program like the TCP/IP server and client but i want it to be web based, so on the clients side they can go on any web browser and be able to connect to the server. How do i approach this, i want to use visual studio c#. I looked up on web sockets, is that the way to go?? ...

How to determine start of data payload in TCP packet?

Hi, I'm writing program for monitoring FTP traffic using raw sockets. Now, I am able to determine start of data in TCP packet using this code: // char * packet; // struct * iphdr; // struct * tcphdr; // ... // check, whether sniffed ethernet frame contains IP and TCP char * data; data = (packet + sizeof (struct ethhdr) + sizeof (str...

How to make my NET.TCP WCF service to handle secure and unsecure communication

Hi! I have a WCF service that needs to handle the following : 1 Service Regular TCP Endpoint Secured customUsernamePassword Endpoint Secured Windows Endpoint The system.serviceModel section looks like this : <system.serviceModel> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> <behaviors> <s...

String version of term_to_binary

I'm trying to write a simple server that talks to clients via tcp. I have it sending messages around just fine, but now I want it to interpret the messages as Erlang data types. For example, pretend it's HTTP-like (it's not) and that I want to send from the client {get, "/foo.html"} and have the server interpret that as a tuple containin...

How to build message from tcp segments.

Hi, working in C#, I use SharpPCap to get segments from a winpcap trace. I need to rebuild all the messages sent and received in that trace. In my situation, the client's and server's IP will never be the same. Client's port does not necessarily change. The protocol used by the message could be HTTP or something custom that I don't k...

In .NET how to detect if the TCP port on the server is opened and/or active?

I need to establish a TCP connection with a remote machine, but before I do that, I need to detect, if the port is in use by another application (if there is already one connection on this port). In other words I want to ensure that only one application is using the same port a time. What is the way to do it in .NET? ...

Socket Programming with J2ME

Hello , How can i connect to a TcpServer(using ip & port) with J2ME ? i want to send a request to the server and get responses ! ...

tcp message incomplete

hi, I'm using html5 websockets, dev.w3.org/html5/websockets/, and php socket functions, php.net/manual/en/ref.sockets.php. My problem is that messages sent from the client using websockets to the server are being truncated to a maximum of 1449 bytes. When I set net.ipv4.tcp_timestamps to 0, a couple extra bytes are received. I am using ...

Capturing and assembling TCP streams with libnids

Hello, I've been writing a simple sniffer tool. I started out with libpcap, but then realized it would be useful to keep track of TCP stream information, so I began reading about and experimenting with libnids. It's a great tool, however it does not create a new record in its internal hash table of streams if it does not witness the T...