network-programming

Java Network / Socket programming tutorial

Hi everyone, I'm going to create a project in some month in a course I'm having and for that purpose I would like to read and try making some small test programs regarding the network / socket programming in Java. Ideally, what I'm looking for is a tutorial with description and a end program to create where I can between two computers ...

How to send large data using C# UdpClient?

I'm trying to send a large amount of data (more than 50 MB) using C# UdpClient. So at first I split the data into 65507 byte blocks and send them in a loop. for(int i = 0; i < packetCount; i++) myUdpClient.Send(blocks[i], block[i].Length, remoteEndPoint); My problem is that only the first packets can be received. During sending t...

nmap ports scan closes udp socket on windows open by ipworks v4

Upon receiving UDP packets from nmap (port scanner), UDP socket that were open by ivrworks (v4) is being closed without any notification. Has anyone encountered such a problem ...

Connecting to tcp server from client running in android device

Hi, I am trying to connect to a standalone desktop tcp server(java) from tcp client application in android device. But I am not able to connect to that. I tried to write a desktop tcp client and tried to connect to server(remote server). It is working fine. But When I am trying to connecting from android, I am getting a IOException wh...

boost::asio: thread local asynchronous events.

I will be creating x amount of threads in my server-app. x will be the amount of cores on the machine, and these threads will be (non-hyperthread) core-bound. Naturally with this scheme I would like to distribute incoming connections across the threads with the aim of ensuring that once a connection is assigned to a thread, it will only ...

AutoDisovery is selecting the wrong network interface

I wrote a simple application using REALBasic The issue is that AutoDiscovery is binding to the wrong interface. The machine has 1 physical and two virtual NIC cards. The virtual ones are there because of VMWare How can I bind to the physical card? ...

how to know which is the last TCP segment received by the server when data is transferring?

When transferring data in TCP, and given all the incoming and outcoming packets, how will one know if the packet received is the last of the data? TCP packets are fragmented into smaller parts. I'm transferring over the HTTP protocol. ...

How to broadcast a message in a network?

Hi, I'm working on a client-server application written in C, I want to broadcast a message to all the machines available in the network. How can I do that using the usual socket system calls in C ? Thank you! ...

Maximum number of concurrent connections on a single port (socket) of Server

Hi, What could be the maximum number of concurrent Clients(using different port number) that could communicate to a Server on the same port (Single socket) ? What are the factors that could influence this count ? I am looking for this information w.r.t telnet in linux environment. Thx in advans, Karthik Balaguru ...

Callback, observers, and asynch sockets in Python.

I'm still a neophyte Python programmer and I'm trying to do something that is a bit over my head. What I've done is create a simple IRC bot using asyncore (and asynchronous sockets module). The client runs in a continuous loop, listening to the conversation in the channel. What I would like to do (I think?) is implement an observer pa...

Threads,Sockets and Streams

In my program I want to send some information to another computer with sockets. The first socket send some text throw the server and when the second socket receive this information it send a answer to the first socket. The problem is that another thread receive the answer and the only thing which I get is deadlock. This is the server sid...

Java: Proper Network IO handling?

The problem I am having is that when I use an InputStream to read bytes, it blocks until the connection is finished. EG: InputStream is = socket.getInputStream(); byte[] buffer = new byte[20000]; while (is.read(buffer) != -1) { System.out.println("reading"); } System.out.println("socke...

how to know if a packet sniffed is accessed from a website directly and not linked?

is there any way to know if a certain tcp segment which has a request message to a server is directly accessed by a user through a browser. not just that its linked by the browser itself to complete the requested page. like for example, a web page with images, when one browses this page, the sniffer tends to get all this urls including ...

Performance of IPX/SPX and TCP/IP

Hi, I understand that IPX and SPX both provide connection services similar to TCP/IP. Here, IPX is similar to IP and SPX is similar to TCP and hence eager to know about this. How does the performance of IPX/SPX exceed that of TCP in LAN ? Why is IPX/SPX not used in LAN alone if its performance is superior to that of TCP in the case of L...

Accessing TCP/IP routing information from a .NET application

I need to check if a TCP/IP route already exists from my application and add the route if it doesn't. Now I'm running the route add <destination network ip address> MASK <mask> <gateway ip address> with a Process.Start() and that's fine for me. However, as I'm elevating the route command with a "runas" verb, I need to check first if ...

Posting to internal socket fails when firewall is enabled

I'm working on an application where two processes communicate over loopback interface. Its Linux based system. I'm encountering a very strange problem, when Firewall is enabled, send to internal socket is failing. If I add an iptables rule (in output chain) as shown below from command prompt everything works fine. iptables -I OUTPUT ...

Network byte order conversion with "char"

I've always been taught that if an integer is larger than a char, you must solve the byte ordering problem. Usually, I'll just wrap it in the hton[l|s] and convert it back with ntoh[l|s]. But I'm confused why this doesn't apply to single byte characters. I'm sick of wondering why this is, and would love for a seasoned networks programme...

Rationale behind ACKs and SEQs?

I am not sure if people find this obvious but I have two questions: During the 3-way handshake, why is ACK = SEQ + 1 i.e. why am I ACKing for the next byte that I am expecting from the sender? After the handshake, my ACK = SEQ + len. Why is this different from the handshake? Why not just ACK for the next byte I am expecting as well (th...

TcpListener.Start() does not open the port

Hello, I have a class that inherits from the TcpListener, this class Shadows the Start method just to call the base Start() and the base BeginAcceptTcpClient(). From time to time the method is called but the port is not opened (netstat does not show the port open). The class looks like this Public Class ExtendedTcpListener Inherit...

localhost vs LAN : speed difference?

I'm currently in the process of performance profiling. We have a basic client/server application. Would the TCP transfer speed be different if I ran client/server on the same machine (localhost) vs across two computers on a LAN? ...