network-programming

Problem receiving UDP message from server.

I have to connect to a remote server via UDP and send a predetermined message to it in order to get a message back. I had first tried this in TCP and it worked but in UDP after I send the message and listen for the reply in recvfrom() I get nothing. Can anyone tell me what might be the problem here. if ((bytes_sent = sendto(sockfd, UDP_...

iPhone app architecture

Hi all, considering good design, is it better for each view controller to manager their own connection / networking / loading, or to centralize it in the app delegate, or a separate object? Context: I have a multi-tab app, each with a navigation controller, and a number of view controller below. Each view controller is doing networ...

gSOAP 2.7.15 Adds a redundant namespace to the message header

Hi, I upgraded my application to use gSOAP 2.7.15 (instead of 2.7.9L). In 2.7.9L I added a code to insert the namespaces to the message header - and it worked fine. In 2.7.15, the namespaces are being inserted automatically but WS-Addressing namespace appears twice!! Any idea?? ...

how to get the IP address and port number from addrinfo in unix c

i need to send some data to a remote server via UDP in a particular port and get receive a response from it. However, it is blocking and I get not response. I needed to check if the addrinfo value that I get from the getaddrinfo(SERVER_NAME, port, &hints, &servinfo) is correct or not. how do i get the ip address and port number from this...

Connecting from host to virtual server fails with network unreachable from Java.

I have a server that has several virtual machines running on it. I'm trying to connect to one of these servers using Java, but it fails with "Network unreachable". The usecase is Hudson connecting to run a slave on a windows-machine. It works using python sockets, so it's quite odd. This is the network configuration on the host machine ...

Is there a command similar to iwevent to monitor eth0 state?

I want to setup my computer to run certain commands when I join or leave certain networks (ie: Start up Synergy when at work; Start up ssh when on the lan at home so I can sync, etc...). I found iwevent which outputs events to the wireless interface that I can watch. However I can't find an equivalent to watch when eth0 is connected or ...

Variable sized packet structs with vectors

Lately I've been diving into network programming, and I'm having some difficulty constructing a packet with a variable "data" property. Several prior questions have helped tremendously, but I'm still lacking some implementation details. I'm trying to avoid using variable sized arrays, and just use a vector. But I can't get it to be trans...

For distributed applications, which to use, ASIO vs. MPI?

I am a bit confused about this. If you're building a distributed application, which in some cases may perform parallel operations (although not necessarily mathematical), should you use ASIO or something like MPI? I take it MPI is a higher level than ASIO, but it's not clear where in the stack one would begin. ...

What is the right approach to checksumming UDP packets

I'm building UDP server application in C#. I've come across a packet checksum problem. As you probably know, each packet should carry some simple way of telling receiver if packet data is intact. Now, UDP already has 2-byte checksum as part of header, which is optional, at least in IPv4 world. Alternative method is to have custom check...

Active Directory Programming help needed

Hello Friends, I want to make Windows Service in .NET which has to run on Windows Server 2003, 2008. The main functionalities i need are: As soon as a network user logs in, Display his: User name in Active Directory Domain Ip Address from where he connected I do not want to install or run any program/script on the client machine. ...

Do the Nagle Algorith and Delayed ACK's affect TCP Connection Setup?

Do the client's SYN and the servers SYN+ACK get delayed by Nagle? Will the client's ACK of the server's SYN get delayed? Will connect return after rtt+spt or will it take rtt + spt + 2x Nagle Delay? Or more generally, how do the Nagle Algorith and Delayed ACK's affect TCP Connection Setup? ...

Can 'connect' call on socket return sucessfully without server calling 'accept'?

Server has created a socket and bound to a port and started a thread which is in loop to accept the connection. Sometime later loop exited due to an exception resulting in thread exit but socket is still bounded to port. Now if client does a 'connect' to this server, it is succeeding. How is it possible? If I understand correctly, 'conne...

tcp application exit will send FIN always?

Hi, When a TCP application exits it will send a FIN packet. Consider a tcp client which get connected to a always listening server(server never exits). if the tcp client is exiting abruptly after few exchange of packets, will it always send a FIN packet to the server? Thx! ...

Is it possible for me to accept a connection and have it die withouit my knowing, then accept antoher connection on the same socket number?

Is it possible for me to accept a connection and have it die withouit my knowing, then accept another connection on the same socket number? I've got a thread to do protocol parsing and response creation. I've got another thread to handle all my network IO and one more thread to handle new incomcing connection requests. That makes three ...

TCP, HTTP and the Multi-Threading Sweet Spot

I'm trying to understand the performance numbers I'm getting and how to determine the optimal number of threads. See the bottom of this post for my results I wrote an experimental multi-threaded web client in perl which downloads a page, grabs the source for each image tag and downloads the image - discarding the data. It uses a non...

which protocol used for developing a chat application over LAN?

Hi I would like to create a chat application(desktop-app) in c++, so which protocol i would need to study and implement. UDP(?) Please provide me some good thoughts and advices and links also. ...

Can read() function on a connected socket return zero bytes?

I know that read() is a blocking call unless I make the socket non-blocking. So I expect read() call which requests 4K of data should return a positive value ( no of bytes read) or -1 on error ( possible connection reset by client etc). My question is: Can read() return '0' on any occasion? I am handling the read() this way: if ((r...

How does sending tinygrams cause network congestion?

I've read advice in many places to the effect that sending a lot of small packets will lead to network congestion. I've even experienced this with a recent multi-threaded tcp app I wrote. However, I don't know if I understand the exact mechanism by which this occurs. My initial guess is that if the MTU of the physical transmission med...

Is it possible to program iphone to alter wireless router settings?

I want to use my iphone to set alter my wireless router settings, and I don't want to go through 192.168.1.1 - is there any security restrictions or SDK limitations I should be aware of starting off? -- t ...

How to detect internet connectivity using java program

How to write a java program which will tell me whether I have internet access or not. I donot want to ping or create connection with some external url because if that server will be down then my program will not work. I want reliable way to detect which will tell me 100% guarantee that whether I have internet connection or not irrespecti...