sockets

C# Socket Server Send Question

I have a .net 2.0 application that uses the System.Net.Sockets Send() method to send data at regular intervals e.g. every minute. Essentially it is a socket server. Most of the time there will be no clients connected to receive this data but occasionally a user will run an app which will connect to monitor the data that is being sent at ...

Asynchronous IO in Java?

What options for async io (socket-based) are there in java other then java.nio? Also does java.nio use threads in the backround (as I think .NET's async-socket-library does, maybe it's been changed) or is it "true" async io using a proper select call? ...

How to bring down a socket on a windows machine?

I have a application which I suspects to get into problems because network nodes closes its sockets to various other servers it communicates to. I would like to mimic that behaviour by shutting down one or severel connections that can be seen in netstat. I'm not an expert in networking on OS level, so this question may be stupid, if so d...

What is the upper limit on the number of open sockets i can have in win2003 server

Hi. i'm building a chat server with .net i need to know is there a limit on the number of open sockets i can have on windows 2003 server box Also, i tried opening about 2000 client connections and my linksys WRT54GL router (with tomato firmware) drops dead each time. The same thing happens when i have several connections open on my Azur...

How to get amount of non-ACK-ed TCP data for the socket?

Linux has ioctl SIOCOUTQ described in man-page tcp(7) that returns amount of unsent data in socket buffers. If I understand kernel code right, all the non-ACKed data is counted as "unsent". The ioctl is available at least since 2.4.x. Is there anything alike for {Free,Net,Open,*}BSD, Solaris, Windows? ...

Are there any open source cross platform NAT punch throughs?

Are there any open source cross platform NAT punch throughs? ...

NetXtreme II (BCM 5708) UDP Packets Per Second?

Does anyone else have any benchmarks on how many packets per second this NIC can receive without dropping any UDP traffic? Using 64 byte UDP packets, I'm seeing roughly 100k packets/sec until drops. ...

what is a good Pattern for using AsyncSockets in .net35 when inititiating several client connections

I'm re-building an IM gateway and hope to take advantage of the new performance features in AsyncSockets for .net35. My existing implementation simply creates packets and forwards IM requests from users to the various IM networks as required, handling request/ response streams for each connected users session(socket). i presently have...

Do i need one SocketAsyncEventArgs for each client connection made?

Please do i need a new SocketAsyncEventArgs for each client connection i make. I'm making several client connections in a loop, filling in the UserToken for each clients state from a database. Is there a way to reuse the SocketAsyncEventArgs and still maintain separate UserToken state for each connection. Thanks. ...

Java Threadpool vs. new Thread in high request scenario

I have some old java code for a REST service that uses a separate thread for every incoming request. I.e. the main loop would loop on socket.accept() and hand off the socket to a Runnable which then would start up its own background thread and invoke run on itself. This worked admiringly well for a while until recently i noticed that the...

Is broadcasting faster than a random SYN/ACK scan for a particular port?

The project I'm working on uses P2P to transfer data between peers much unlike Bittorrent. This component does a random scan on each interface to see what devices are on the network. So far it has been implemented as a Socket connection which checks whether it has succeeded in connecting by trying to connect to the program's listening po...

How to implement chat using jQuery, PHP, and MySQL?

I have made a chat script using php, mysql and jquery. It uses json to get data from the server. It makes fixed interval requests to the server with the lastly fetched message id to get new messages from the server. But when multiple users will be chatting then thousands and crores of requests will be made to the server within an hour an...

socket passing between processes

Is there a way to pass a socket between processes (not same address space) in Windows? I find this info Shared Sockets, therefore believe that it is possible. "The WSADuplicateSocket function is introduced to enable socket sharing across processes"... More info : at source code of Apache (httpd-2.2.11-win32-src.zip) have usage for api...

How to tell which interface the socket received the message from?

If a socket is bound to IN6ADDR_ANY or INADDR_ANY and you use a call such as recvfrom() to receive messages on the socket, is there a way to find out which interface the message came from? In the case of IPv6 link-scope messages, I was hoping that the from argument of recvfrom() would have the scope_id field initialized to the interfac...

networking design ; socket communication using polling

A few words about an ongoing design and implementation I send a lot of requests to the remote application (running on a different host, of course), and the application send back data. About client Client is a UI that spawn a separate thread to submit and process the requests. Once it submits all the requests, it calls Wait. And the ...

python: how to send packets in multi thread and then the thread kill itself

Hi, I have a question. I'd like to send a continuous streams of byte to some host for certain amount of time (let's say 1 minute) using python. Here is my code so far: #! /usr/bin/env python import socket import thread import time IP = "192.168.0.2" PADDING = "a" * 1000 #assu...

Socket Programming

Am trying to create a server application in c#.In the code am using the TcpListener class. TcpListener t = new TcpListener(5555); t.Start(); However it is providing an error saying: Invalid token '(' in class, struct, or interface member declaration. Are there additional references required?. Please help. namespace Wi...

Testing of socket communication program

Am starting with socket programming with a simple UDPClient program to send some data. The large code snippet is below: using System; using System.Text; using System.Net; using System.Net.Sockets; using System.Threading; class ShowIP { public static void Main(string[] args) { string name = Dns.GetHostName(); //n...

Can signed applets connect with a different host from which they originate?

I need an applet to open a socket and communicate with a server listening on the local host to which the applet downloaded (the end user machine). contrary to what I have read about applet security, it seems that even signed applets cannot open a socket to a different host from which they were downloaded (on the same machine it works p...

Problem with IP_HDRINCL?

I already asked this question on raw IP packet implementation. But I didn't get any solutions. My code: if((s = WSASocket(AF_INET, SOCK_RAW, IPPROTO_TCP, 0, 0, 0))==SOCKET_ERROR) // Socket { printf("Creation of raw socket failed."); return 0; } if(setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *)&optval, sizeof(optval))...