networking

Is url.openStream harmful?

I was using the java.net.URL.openStream() method to retrieve content from the server. I recently ran into an issue where the HTTP Response code indicated an error, but instead of throwing an exception, the stream still was read anyway. This caused the error to appear much later in the execution and proved to be a red herring. As far as I...

Socket.recv works but not gets or read?

Hello I've been messing around with Sockets in Ruby some and came across some example code that I tried modifying and broke. I want to know why it's broken. Server: require "socket" dts = TCPServer.new('127.0.0.1', 20000) loop do Thread.start(dts.accept) do |s| print(s, " is accepted\n") s.write(Time.now) print(s, "...

zigbee vs bluetooth

Hey guys We all know about bluetooth cos its more popular. But why is it popular? After reading about Zigbee i found out that it has lower power consumption, higher range in terms of distance and costs lower and is simpler! So why dont we have Zigbee enable phones? Also I would like to know a per device cost estimation between bluetoot...

How can I programmatically find the IP address/netmask/gateway configured for a specific network device in Linux?

Hi I would like to write a piece of code which checks, for each network device (e.g. eth0, lo, master devices) some statistics and configuration data about that device. I could find the statistics data (and most of the configuration data) in /sys/class/net/..., however, I couldn't find any C/C++ API or any entry in procfs/sysfs listing t...

networking application and GUI in python

I'm writing an application that sends files over network, I want to develop a custom protocol to not limit myself in term on feature richness (http wouldn't be appropriate, the nearest thing is the bittorrent protocol maybe). I've tried with twisted, I've built a good app but there's a bug in twisted that makes my GUI blocking, so I've...

How to find the Instantaneous size of the transmission buffer in Linux kernel?

I want to measure the instantaneous size of the transmission buffer or the number of packets waiting to be sent on an Ethernet interface. The problem is that the kernel takes the packet from the transmission queue and puts it in a Transmission Ring Buffer (Tx-Ring) before sending it out on the wire. Therefore: Total instantaneous size...

migrating Solaris to RH: network latency issue, tcp window size & other tcp parameters

Hello I have a client/server app (Java) that I'm migrating from Solaris to RH Linux. since I started running it in RH, I noticed some issues related to latency. I managed to isolate the problem that looks like this: client sends 5 messages (32 bytes each) in a row (same application timestamp) to the server. server echos messages. clie...

Question about POP3 message termination octet

This is from the POP3 RFC. "Responses to certain commands are multi-line. In these cases, which are clearly indicated below, after sending the first line of the response and a CRLF, any additional lines are sent, each terminated by a CRLF pair. When all lines of the response have been sent, a final line is sent, consisting...

OS-independent Inter-program communication between Python and C

I have very little idea what I'm doing here, I've never done anything like this before, but a friend and I are writing competing chess programs and they need to be able to communicate to each other. He'll be writing mainly in C, the bulk of mine will be in Python, and I can see a few options: Alternately write to a temp file, or succe...

Captive portal with TekRADIUS + DDWRT + Chillispot?

I need to set up my router (DD-WRT firmware installed on it) to redirect users to a web application that authenticates them. I still haven't understood very well the entire process. I've installed TekRADIUS and a PHP application called hotspotlogin.php but not sure how to integrate DD-WRT, TekRADIUS and the PHP application. I intend to r...

Should I use the java.net or org.apache.http library for HTTP in my Java application?

What should I know about the trade-offs between these two HTTP libraries? ...

How to detect non-graceful disconnect of Twisted on Linux?

I wrote a server based on Twisted, and I encountered a problem, some of the clients are disconnected not gracefully. For example, the user pulls out the network cable. For a while, the client on Windows is disconnected (the connectionLost is called, and it is also written in Twisted). And on the Linux server side, my connectionLost of t...

Books recommendation to learn about java networking

In order to cover for my (glaring) lack of knowledge in the basics of networking, I'm looking for a book which would ideally cover: -> 1 or 2 chapters on the transport layer: tcp, udp... -> 1 or 2 chapters on the application layer: http, dns... -> rest of the book would be devoted to pratical way of sending data across the wire using ...

Add Route through a VPN in Mac OS X

Is there an equivalent to add route in Mac OS X? On my Windows machine I can connect to our web server via VPN and then create a route on the to so we can access the MSSQL Server and make Remote Desktop Connection without have to enable remote gateway. This let's us develop and test in the same session without disconnecting. Now that I...

A software/hardware structure of the Google Search/Maps Linux-clusters ?

I am particularly interested how one can deal with a huge amount of information for a commercial service like Google Search or Google Maps. We all know they use (or "did" at least) a kind of Linux clusters, but how exactly are they organized? What kind of hardware do they use, what file systems, networking, what problems are the most fre...

I want to establish a TCP/IP connection over a UART connection (Windows XP/7)

I want to connect two computer via serial but for each to see each other via a TCP/IP connection. Ie, create new network device on the computers that are in actual fact serial ports. The reason for this is that I am actually testing the medium in which the serial connection is made (wireless), and part of the experiment will be to use T...

Is there a packet sniffer for Windows Mobile?

I'm looking for a tool along the lines of Fiddler, or better yet Wireshark, that would run on a Windows Mobile 6.1 device. I have an app which calls some webservices on one of our servers, and I want to make sure it it going out to the proper address. Thanks in advance. ...

Outgoing UDP sniffer in python?

I want to figure out whether my computer is somehow causing a UDP flood that is originating from my network. So that's my underlying problem, and what follows is simply my non-network-person attempt to hypothesize a solution using python. I'm extrapolating from recipe 13.1 ("Passing Messages with Socket Datagrams") from the python cookbo...

What to do when ServerSocket throws IOException and keeping server running

Basically I want to create a rock solid server. while (keepRunning.get()) { try { Socket clientSocket = serverSocket.accept(); ... spawn a new thread to handle the client ... } catch (IOException e) { e.printStackTrace(); // NOW WHAT? } } In the IOException block, what to do? Is the Server ...

Buffer management for socket application best practice

Having a Windows IOCP app............ I understand that for async i/o operation (on network) the buffer must remain valid for the duration of the send/read operation. So for each connection I have one buffer for the reading. For sending I use buffers to which I copy the data to be sent. When the sending operation completes I release th...