tcp

check status of one port on remote host

I need a command line that can check the port status on a remote host. I tried ping xxx.xxx.xxx.xxx:161 but it doesn't recognize the "host". I thought it was a "good" answer until I did the same command against a host I know has that port open. This is for a batch file on Windows that will check the status of the remote port then run...

Java TCP socket: data transfer is slow

I set up a server with a ServerSocket, connect to it with a client machine. They're directly networked through a switch and the ping time is <1ms. Now, I try to push a "lot" of data from the client to the server through the socket's output stream. It takes 23 minutes to transfer 0.6Gb. I can push a much larger file in seconds via scp...

Measuring the HTTP response time back to the client using only the server

I need to measure how long it takes to send a web response to a client - from the server-side only. I know there are ajaxian and client-side ways of doing this but I am limited to a server-side only way of measuring the time to the client. Is it possible to roughly approximate this using the ACK sent back from the client browser after t...

How to enumerate bound UDP / TCP sockets on Windows in C

Assuming that you do not have access to the SOCKET handlers. ...

Looking for a Basic Reverse Shell Example in C(++)

I'm trying to find a basic reverse shell example in C or C++, Basically I want to write a code to simulate the following netcat scenario: Listener: ------------------ C:\nc -L -p 80 Client -------------- C:\nc 127.0.0.1 80 -e cmd.exe For whom doesn't speak netcat: This means I want to redirect stdin and stdout from cmd.exe to netwo...

How should a HTTP server (using sockets) detect that the client is no longer connected and abort processing?

I'm implementing a basic HTTP Server in C++, using boost::asio. As I process each request, I write out the data in chunks, asychronously. If at any point I knew the client was no longer connected, I'd like to abort the processing, e.g. there's no point continuing to build results up to send out if the client is no longer there. I thin...

Speed up my Java tcp transfer!

I need to speed up transfers across my gigabit ethernet connection. Right now, I'm doing something almost exactly like this, but I'm only seeing about 40% of that when I run this code below. I also ran this script on all of my (Mac Pro) machines before testing #!/bin/bash sudo sysctl -w net.inet.tcp.win_scale_factor=8 sudo sysctl -w ...

How to fix "a connection attempt failed because the connected party did not properly respond after a period of time ..." error?

I'm making a game in C# and I want to display the progress (movements and so on) of opponent. So I send events in game via TCP protocol to opponent. I've already tried my application on localhost and it works but when I try to use my external address in order to communicate over the internet I get the error below in class TcpInformer.Co...

C# Async socket problem

Hi everyone, I'm having a weird problem with my code, at the moment everything works fine, except the sending part. Whenever I try to send a packet it actually sends many empty packets, and I can't find out why, I've checked with the debugger and the SendPacket function is being called only once. Thanks to everyone! ...

Create a Windows (win32) service discoverable across the network

In short: How to reliably discover a server running somewhere on a (presumably multi-segmented) local area network with zero client configuration My client application has to locate the server application without knowing the server IP address. It has to work on a local LAN that may be split into segments with hubs or other switching dev...

TCP Vs. Http Benchmark

I am having a Web application sitting on IIS, and talking with [remote]Service-Machine. I am not sure whether to choose TCP or Http, as the main protocol. more details: i will have more than one service\endpoint some of them will be one-way the other will be two-ways the web pages will work infront of the services we are talking about...

programatically evaluating the value of somaxconn, to set the listen backlog parameter.

For server side programming I use the listen function as: int listen(int sockfd, int backlog); I understand that the backlog should be less than or equal to the somaxconn set on the host system where I would run my server program. If I use SOMAXCONN as the backlog, it will be equivalent to hard-coding it to the value of SOMAXCONN that ...

Why is UDP + a software reliable ordering system faster than TCP?

Some games today use a network system that transmits messages over UDP, and ensures that the messages are reliable and ordered. For example, RakNet is a popular game network engine. It uses only UDP for its connections, and has a whole system to ensure that packets can be reliable and ordered if you so choose. My basic question is, wha...

Listening to a port securely using .NET 3.5

I want to listen to a port on a server, and securely process the files. Are there any standard ways to listen in .NET 3.5 or any recommendations. The data is coming from a 3rd party tools and we can route the outbound to any port. Any Ideas and recommendations. Can WCF be used?. ...

Objective-C Bonjour/TCP Stack

Hi guys/girls, I was wondering if anyone knows of a combined Objective-C Bonjour/TCP stack out there, that would allow me to forget about managing sockets, broadcasting services etc and instead let me just host a service and/or get a list of existing services and connect to one. Then just continue by sending messages either to specific ...

ADO.Net DS Client: DataServiceContext.BeginExecuteBatch fails to connect

I have a Silverlight 2.0 application using IIS7 and Sql 2008. I'm using ADO.Net Data Services to expose our Entity Framework objects to the SL client. What I am seeing is that on a particular request in my application I initiate a batch request with 4 different service queries; for some reason in certain cases no HTTP request is ever iss...

How do I open a TCP socket from SilverLight?

I need to know how to open a TCP socket connection from Silverlight. How is it done? ...

TCP Connection problem (vb .net)

I created a vb .net app and basically it connects to the server (my brother's computer at his house) and sends messages. The problem I'm having is, we both have routers. The only way I'v gotten all of this to work, is by both of us connecting ppeo broadband and then our ips work, otherwise the "real ip" is used for all the pcs in my hous...

What TCP protocols are usable for client to client communication?

Manytimes clients ask for features like instant messaging (IM) and other client-to-client (P2P) communication for their web apps. Typically how is this done in normal web browsers? For example I've seen demos of Google Wave (and Gmail) that are able to IM from a regular browser. Is this via HTTP? Or does XmlHttpRequest (AJAX) provide the...

Accessing LDAP through SSH tunnel

Hello, I got access via SSH (root access) to a Machine that's inside a network at my client's office. I'm programming in my computer a PHP application that needs to integrate to LDAP. The LDAP server is in another server at my client's network and not accesible from outside, however I can perfectly access it via the server I can conne...