network-programming

What is the Recommended Ping and URL Connection Timeouts?

I am currently doing some network programming and had a couple questions concerning timeouts. Is there a recommended timeout in doing a ping? Also, is there a recommended timeout in doing a URL connection? Edit: In my case, with the ping, I am just trying to see if a device is connected to the network. With the URL connection, I am tr...

Are singleton network event processors okay?

Suppose you have a system on the other side of a network that sends events and data that needs to be cached to some intermediate broker. Instead of giving every component of your application that needs to be informed of such events a new subscription to the broker, I decide for performance and simplicity (the third party library that ha...

How to read an incoming tcp stream until a delimiter is found?

How do you read an incoming tcp stream until a specific delimiter is found in C#? The only possible solution I have come up with is reading the incoming stream one byte at a time. ...

Testing for a closed socket

I'm trying to test for a closed socket that has been gracefully closed by the peer without incurring the latency hit of a double send to induce a SIGPIPE. One of the assumptions here is that the socket if closed was gracefully closed by the peer immediately after it's last write / send. Actual errors like a premature close are dealt wi...

Cancel UDP recvfrom in C on Unix

I'm just starting to learn how network programming in C works, and I've written a small program that sends messages to and from a UNIX terminal. I'm using pthreads in my program, one of which essentially just waits on recvfrom() to receive a message. However, I want to be able to close all threads properly if the users chooses to quit t...

Network file transfer in Windows

I want to transfer files across the network using C or C++. What topics should I look up? How can I do this? ...

question about pcap

hi, i have to do a sniffer as an assignment for the security course. i am using c and the pcap library. i got everything working well (since i got a code from the internet and changed it). but i have some questions about the code. u_int ip_len = (ih->ver_ihl & 0xf) * 4; ih is of type ip_header, and its currently pointing the to...

using raw sockets

is it possible to use raw sockets (on windows) to close a connection between 2 hosts? if yes then is this the best practice. i am not a cracker, i have a security assignment of 2 phases. phase 1- is to create a sniffer. phase 2- is to create a raw socket and choose a sniffed packet and attack the connection to close it. so how should i d...

How to gain greater control of network packets on Android

I'm looking to design an application that will require some deep control over IP packets. Looking over the reference guide on the developers site at Android I see very limited control over packets from java.net:SocketOptions and java.net:DatagramPacket. Specifically I'm looking to control the individual bits within the packet to set TCP ...

Are there some general Network programming best practices?

I am implementing some networking stuff in our project. It has been decided that the communication is very important and we want to do it synchronously. So the client sends something the server acknowledges. Are there some general best practices for the interaction between the client and the server. For instance if there isn't an answer...

Which development Language is best suited to Network Inventory

Dear stackoverflow I hope this is the corrcet type of question for stackoverflow to consider I would like to develop a "Hard Core" application that performs Network Inventory. High level requirements are Work on Windows and UNIX networks it has to be extremly performant it has to be 100% accuarate (massively) scalable and fun to writ...

How to solve a deallocated connection in iPhone SDK 3.1.3? - Streams - CFSockets

Hi everyone, Debugging my implementation I found a memory leak issue. I know where is the issue, I tried to solve it but sadly without success. I will try to explain you, maybe someone of you can help with this. First I have two classes involved in the issue, the publish class (where publishing the service and socket configuration is ...

Linux network programming. What can I start with?

Hi everyone! I've recently got interested in Linux network programming and read quite a bit (Beej's Guide to Network Programming). But now I'm confused. I would like to write something to have some practice, but I don't know what exactly. Could please recommend me a couple of projects to start with? Thanks. ...

SNMP Broadcast on Windows

I'm writing an SNMP agent in windows. The agent responds fine simple get and get-next request sent directly to computer's ip address. But when I do a SNMP broadcast, the computer receives the packet but does not anwer that. Why is that? The firewall is off and the antivirus too. ...

Parallel implementation to maximise network flow

I am preparing a paper on the parallel implementation of goldberg's algorithm for maximizing network flow. Please help me with the implementation details. if someone has access to acm library i would really appreciate if you can get me the paper by anderson and setubal on it. - [email protected] ...

Strange client's address returned throug accept(..) function.

Hi everyone, I'm a socket programming newbie. Here's a snippet: struct sockaddr_storage client_addr; ... client_addr_size = sizeof(client_addr); client_socket = accept( server_socket, (struct sockaddr *)&client_addr, &client_addr_size ); ... result = inet_ntop( AF_INET, &((struct sockaddr_in *)&client_addr)->sin_addr, ...

BSD Sockets don't behave in a iPhone 3G environment

I noticed that many times while developing for an iPhone 3G, BSD socket functions will simply fail. I also noticed at the time, the 3G antenna wasn't even ON, nor was there WIFI Access to back up the network call (So it seems ridiculous that it doesn't turn on to support the network request).. This information was verified with an app ...

How to access File over the Network

Hi! I am having a hard time on this one, I have a folder over the network with public access (no credential restriction). I am trying to do a File.Exist or Directory.Exist and I keep on having a exception. Can someone tell me the good way to do IO over the network. EDIT 1 FOR DETAILS: if i do execture => \agoodip\Public\test.txt I ge...

Few question about client application to be networked

I have made a registration program. Making use of mysql database. Can I still use the traditional programming for client applications. If I want to network it. Do I have to modify the codes a little in order to make it work? -Please enlighten me, I'm just a beginner. I don't have any idea on how this works. Do I have to install wampse...

How to fake source ip-address of a udp-packet?

Hi everyone! Think about the following: Your ISP offers you a dynamic ip-address (for example 123.123.123.123). My question is simple (the answer may not be): Is it possible to send a single udp-packet with an outer source-ip (for example 124.124.124.124) to a fixed-ip server? I don't need to get a answer from the server. I just want ...