Hi
I have a doubt regarding the backlog value in listen system call. From man page of listen system call.
If the backlog argument is greater than the value in /proc/sys/net/core/somaxconn, then it is silently truncated to that value; the default value in this file is 128.
It means my server can accept only <128 connections at once...
In C (UNIX), how can I transfer and receive a file in multiple blocks using a socket?
For example, if I had a file of 1234 bytes, and a block size of 500, I would transfer:
500 bytes,
then 500 bytes,
then 234 bytes
I have attempted this using fseek, read, write, but I just cannot get the logic right. Even a good reference would b...
I'm looking for some C#/.NET library that I can use to do some NAT-Punching for multi-player game development. Using a central server to establish initial connection is OK, but ideally connections would drop into p2p mode after initial communication with server.
...
I need to be able to send and receive UDP packets on the same port.
I am able to listen, on say port 5000, but my send uses a random high port.
The system I am working written in VB with does this and my need is to write a UDP responder for debugging various protocol issues.
I am using the Open Source C++ Sockets Library from http://www...
Hi, what's the best way to pass data between two ruby programs over the internet? The data is small and needs to be passed frequently. Also, since this happening over the internet, it needs to be secure. I'd appreciate any help, extra points for a pointer to some guides on this topic.
...
I've a strange problem with a java server application running on a windows machine;
sometimes the SocketChannel I just obtained by ServerSocketChannel.accept immediately returns an error when I try to read data from it - the strange thing is that at the same time the client that started the incoming connection is stuck waiting for the an...
How efficient is it to use sockets when doing IPC as compared to named pipes and other methods on Windows and Linux?
Right now, I have 4 separate apps on 4 separate boxes that need to communicate. Two are .NET 3.5 applications running on Windows Server 2003 R2. Two are Linux (Suse Linux 10). They're not generally CPU bound. The amou...
I'm building an application that needs to charge users based on the exact bandwidth used by their connections.
I could of course keep track of how many bytes i pass to/from send/receive but that doesn't include IP packet overhead which i'd very much like to include since we're talking lots of small packets of varying size.
I could es...
Hi all,
I'm developing a socket server/client application by JAVA for server and J2ME for client. Everything was ok when I tested the server in my windows XP. However, then, a serious problem occurred, when I deployed my socket server to server running Windows Server 2003. MY Windows server was lost network connection when my client tri...
I have a fairly basic TCP server keeping track of a couple connections and recv'ing data when it's available. However, I'd like to artificially trigger an event from within the program itself, so I can send my TCP server data as if it came from sock1 or sock2, but in reality came from somewhere else. Is this possible, or at all clear?
s...
I can download multiple files quite fast with many threads at once but the problem is that after a few minutes it tends to slow down gradually to almost a full stop, I have no idea why. There's nothing wrong with my code that I can see and my RAM/CPU is fine.. The only thing I can think of is that urllib2 isn't handling the massive amoun...
I've written a server in Python that is meant to send data to the client in the form "Header:Message"
I would like to be able to have each message sent individually so that the client will need to perform minimal work in order to read the "header" and the "message"
Unfortunately, I can't figure out how to properly flush a python socke...
I have an application handling several Java socket connections to different kinds of remote machines (some PCs, others are embedded devices). These sockets and streams should not close indefinitely except for a very good reason (e.g. crash of remote system).
I frequently encounter an issue where the input stream ends unexpectedly, witho...
I'm trying to send a broadcast and then let the server reply to it:
public static void SendBroadcast()
{
byte[] buffer = new byte[1024];
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
...
Good time of day.
Ruby Code:
def hw_address(iface)
sock = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM,0)
buf = [iface,""].pack('a16h16')
sock.ioctl(SIOCGIFHWADDR, buf);
sock.close
return buf[18..24].to_etheraddr
end
puts hw_address('lo0')
What it do: gets mac-address of interface.
Works on Debian as expect...
Hello, I have a Java socket server that is expecting exactly n bytes from some port. I want to write a Python clients that just sends bytes on some port to the Java server.
Since Python does not have primitives, I'm not sure to send exactly n bytes. Any suggestions?
More details:
I have a Java DatagramSocket that takes in n bytes:
Da...
How to create socket-based ( Binary Socket) WCF server server with WCF, C#?
What do I need? I need -
Open Source Libs
Tutorials
Blog posts/Articles
...
Hi all,
I think this question is really about my understanding of Garbage collection and variable references. But I will go ahead and throw out some code for you to look at.
// Please note do not use this code for async sockets, just to highlight my question
// SocketTransport
// This is a simple wrapper class that is used as the 'st...
How to create simple C# Binary socket server (Not WCF!)
Who knows the Simplest Way To Open and Use a Socket in C# (Not with WCF)?
What do I need? I need -
Open Source Libs
Tutorials
Blog posts/Articles
Vote!) one who will take at least (0+25) votes wins
...
I am using Ruby to test a C# networking application, which uses sockets. I open the connection with @socket = TCPSocket.new(IP,PORT) and it works - until the text I want to send is longer than 1024 characters. Then Ruby splits the message into 2 parts. C++ and C# send the message as one packet, so the C# application doesn't need to join ...