tcpip

More TCP and POSIX sockets listen() and accept() semantics

Situation: The server calls listen() (but not accept()!). The client sends a SYN to the server. The server gets the SYN, and then sends a SYN/ACK back to the client. However, the client now hangs up / dies, so it never sends an ACK back to the server. The connection is in the SYN_SENT state. Now another client sends a SYN, gets a SYN/AC...

Behavior of shutdown(sock, SHUT_RD) with TCP

When using a TCP socket, what does shutdown(sock, SHUT_RD); actually do? Does it just make all recv() calls return an error code? If so, which error code? Does it cause any packets to be sent by the underlying TCP connection? What happens to any data that the other side sends at this point - is it kept, and the window size of the con...

listen() without calling bind()

I tried the following: int sockfd = socket(...); listen(sockfd, 10); accept(sockfd, ...); None of the calls failed, and the program just started blocking as if I had called bind(). What will happen in this case? Will it just be impossible to ever receive a connection, since it has no local address or port? Or was it implicitly assigne...

.NET: Conditional Socket.Accept

There doesn't seem to be any method of Socket, or ListenSocket that will allow me to conditionally accept connections. When I recieve a SYN, I want to be able decide if I want this connection depending on the source, if I send a SYN/ACK back (accept connection) or a RST (a forceful reject). Is there any want to achieve this? Unfortunat...

How to Disable Windows TCP/IP Stack in VC++ [Programmatically]

Hi I wanted to know How to Disable Windows TCP/IP Stack in VC++ [ Programmatically ]. We are doing some raw socket programming using winpcap. So our application does not need Windows TCP/IP Stack and We Want to uninstall it the moment our application starts. Please help. Thanks in Advance. ...

Freeing up a TCP/IP port?

netstat -tulnap shows me what ports are in use. How to free up a port, in Linux? ...

Is there a limit on number of tcp/ip connections between machines on linux?

I have a very simple program written in 5 min that opens a sever socket and loops through the request and prints to the screen the bytes sent to it. I then tried to benchmark how many connections I can hammer it with to try to find out how many concurrent users I can support with this program. On another machine (where the network bet...

How to create a lot (I mean a lot) of sockets in Linux?

I have tried to create a simple program in different languages (C#, Java, C++, PHP) to connect to a server and all behaved in the same way. So I believe this problem is more of a OS level thing. Basically I want the program to connect to the server with a TCP socket and send 1 byte and then close the socket. This needs to done thousands...

What can cause TCP/IP to drop packets without dropping the connection?

I have a web-based application and a client, both written in Java. For what it's worth, the client and server are both on Windows. The client issues HTTP GETs via Apache HttpClient. The server blocks for up to a minute and if no messages have arrived for the client within that minute, the server returns HTTP 204 No Content. Otherwise,...

Transfer a file through UDP in java

I have the following algorithm implemented in Java which uses TCP/IP: -Client request a file -Server checks if the file exists - if do: send contents of the file to the client - if not: send "file not found" msg to the client Now I`m having trouble implementing that using UDP Datapackets. Here is my code: CLIENT: package br.c...

iPhone/iPod receive messages from C# tcpip server using CocoaAsyncSocket

Hello, i'm trying to send/receive data over wifi to an iphone/ipodtouch app from a C# tcpip server. for this i used cocoaAsyncSocket from the google project. If i push a button and i send a request from ipod to server it returns the requested data(song title for example)..i want to know every second what song is playng...so from C# serve...

Is it possible to communicate with an external system over TCP/IP using WCF?

We are building a system that interacts with an external system over TCP/IP using the FIX Protocol. I've used WCF to communicate from client to server, where I had control over both client and server, but never to an external TCP/IP based system. Is this possible with WCF? If so, could the community provide links for me to get started...

Is it possible to connect a socket between two mobile devices (iPhones) over the internet?

Is it possible to connect a socket between two mobile devices (iPhones) over the internet? I am trying to discover the IP of each device and connect directly. I know it can be done with Bonjour but that only works on local networks. I need a high speed connection between two devices over the internet. Thanks. ...

Easy Button to UDP Packet - Control board terminology

For those who deal with microcontroller programming... I want to take a momentary contact switch (let's say a Staples Easy Button, since that's the most fun momentary contact switch around), and when it is pressed, send a broadcast UDP packet across a network (to be received by a .NET application and do all sorts of fun things from ther...

How to know which Local Application Connected to my socket (Windows)

I have a windows services that bind to some TCP port, this port is use for IPC between my application. Is there a programming (WinAPI/WinSocket and etc) way to know which application connected to my port? i.e. in my Windows Services I would like to get a PID of the process that connected to my port. ...

How to learn about computer networking?

I've read KOZIEROK's the tcp/ip guide(okay,almost.nearly 1100 pages outof 1500).but i found after reading this book,i only grasp how IP,TCP,DNS,BGP,OSPF,NAT(OSI layer 3-4,without 5-7,i.e,TCP.IP application layer) protocol works at the conceptual level,which i thought wasn't that helpful. So,in order to know the bolts and nuts of network...

Cannot access Python server running as Windows service

I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create a Windows service. I installed it on a computer running Windows XP Pro SP3. However, I can't connect to it when it's running as a service. I can confirm that it's binding to the address/port, because I get a conflict when I try to bind to tha...

Threading TCP Server as proxy between connected user and unix socket.

I'm writing web application where I need to push data from server to the connected clients. This data can be send from any other script from web application. For example one user make some changes on the server and other users should be notified about that. So my idea is to use unix socket (path to socket based on user #ID) to send dat...

IIS7/2008 Sql/Service Connection Issues

While trying to get a 2008 server to connect to a sql server, I noticed a change in the 2008 IP stack that has me a bit flummoxed. I'm looking for either an OS way to override this, or a programmatic way in .NET to override this. For the sake of this argument, assume I have a web server with multiple IP addresses to server multiple site...

What is a Connection in JDBC ?

What is a Connection Object in JDBC ? How is this Connection maintained(I mean is it a Network connection) ? Are they TCP/IP Connections ? Why is it a costly operation to create a Connection every time ? Why do these connections become stale after sometime and I need to refresh the Pool ? Why can't I use one connection to execute multipl...