Is there a Linux library that will enable me to tell what IP sockets are owned by what processes? I guess I'm looking for the programmatic equivalent of lsof -i. Ultimately, I want to correlate packets seen through libpcap to processes.
UPDATE: A couple of people have suggested using /proc/<pid>/net/tcp and udp, but on my system, the sa...
Can we call send from one thread and recv from another on the same socket?
Can we call multiple sends parallely from different threads on the same socket?
I know that a good design should avoid this, but I am not clear how these system APIs will behave. I am unable to find a good documentation also for the same.
Any pointers in the d...
Hello,
I am writing client for TCP connection and conversion from IP to socket_addr makes memory leaks.
There is following process:
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
/** there is some code like method header etc. */
hostent * host = gethostbyaddr( ip, 4, AF_INET ); // ip is char[4], I use IPv4
if ( ...
Here's what I've done:
I wrote a minimal web server (using Qt, but I don't think it's relevant here).
I'm running it on a legal Windows 7 32-bit.
The problem:
If I make a request with Firefox, IE, Chrome or Safari it takes takes about one second before my server sees that there is a new connection to be accepted.
Clues:
Using o...
Hi all, i am creating a python server socket that sends data to the client reguarding files status... what i have is a list containing dictionaries:
[{'Status': '[2,5%]', 'File': 'SlackwareDVD.iso'},
{'Status': '[21,8%]', 'File': 'Ubuntu_x86.iso'}]
the socket, when asked, sends this data, obviously it is sent as a string type.. i was...
I'm building a simple server application, and I can connect to it in the Local Network. But I can't connect over the internet.
This is my Server code:
ServerSocket server;
try {
server = new ServerSocket(4000);
} catch(IOException ex) {
System.out.printf("Could not bind socket 4000\n");
System.exit(1);
}
try {
Socket ...
Win 7 and VS2010 B2. I am trying to write a minimal web server using the built-in HttpListener. However, I keep getting an AccessDenied exception. Here is the code:
int Run(string[] args) {
_server = new HttpListener();
_server.Prefixes.Add("http://*:9669/");
_server.Start();
Console.WriteLine("Serv...
[EDITED]
This issue was originally described as my having trouble with Perl's Socket, but I have moved on now to where this is clearly a Flash security thing. However, I'm still stuck.
I have a flash client that attempts to connect to an open socket on the same host as the one on which it lives.
I am able to connect successfully from i...
This is driving me nuts! I am getting the classic "Can't connect to local MySQL server through socket '/var/run/mysql4d/mysql4d.sock' (13)".
Everything I've dug up so far tells me my setup should be OK (eg, defining the sockets in php.ini and my.cnf, etc). Worse... phpmyadmin works with the same un/pw I am using in my own php. So o...
I'm trying to implement an SSL client in Twisted that simply must connect to a socket and read binary data (specifically, tuples of data). I've gotten the code to a point where it seems to connect and disconnect successfully but no data is ever read from the socket.
class FeedbackHandler(LineReceiver):
MAX_LENGTH = 1024*1024
def c...
Sometimes boost::asio seems to disconnect before I want it to, i.e. before the server properly handles the disconnect. I'm not sure how this is possible because the client seems to think its fully sent the message, yet when the server emits the error its not even read the message header... During testing this only happens maybe 1 in 5 ti...
Hello, I'm struggling with following error:
"socket.error: [10053] 'Software
caused connection abort'"
Traceback (most recent call last): ...
self.send(json.dumps([0x02, subItems])+"\n") ...
sent = self.handler.send(data) socket.error: [Errno 10053]
I established server properely, I can connect to it, send "hell...
I am using C and want to know are XML messages are preferable over text messages as far as communication over a socket connection is concerned?
Is there any other good option available rather to go for XML?
Which is the best parser(or parsing option) available for parsing XML in C?
Is there any standard library which comes with C and ...
i would like some help with the following. this is to do with Asynchronous sockets.
from the sender:
string stringData = "Welcome to my server server server";
byte[] message1 = Encoding.ASCII.GetBytes(stringData);
//MessageBox.Show(message1.Length.ToString());
client.BeginSend(message1, 0, message1.Length, SocketFlags.None, new Async...
Hi,
I am trying to write an application which amongst other things uses the openssl blowfish implementation (blowfish.h) to transport files over a simple server/client pair.
However, whilst some files are encrypted, transported, received and decrypted correctly, some end up being corrupted, after the final decryption stage. This lead...
i would like some info on the following:
Socket.BeginSend Method (array<Byte>[]()[], Int32, Int32, SocketFlags, AsyncCallback, Object)
client.BeginSend(message, 0, message.Length, SocketFlags.None, new AsyncCallback(SendData), client);
if the message.lenght is greater than the buffersize (32) do i have to invoke BeginSend multiple ti...
the following is part of a socket class that im working on. what i am stuck with is in serverEndAccept i would like to pass/return a string indicating the accept has been successful. for these am i to use delegates? also by declaring delegates would it not breach the application Model isolation? i.e. i need this to be an independent clas...
In Linux, is it possible for me to open a socket and pass the socket to another process?
If yes, can you please tell me where I can find an example?
Thank you.
...
I am trying to get a handle on what happens when a server publishes (over tcp, udp, etc.) faster than a client can consume the data.
Within a program I understand that if a queue sits between the producer and the consumer, it will start to get larger. If there is no queue, then the producer simply won't be able to produce anything new,...
I'm developing a dedicated game server on a linux machine, in C/C++ (mixed). I have the following snippet of code:
int sockfd=socket(AI_INET, SOCK_DGRAM, 0);
if(sockfd==-1)
{
int err=errno;
fprintf(stderr,"%s",strerror(err));
exit(1);
}
My problem here, is that socket is returning -1 (implying a failure) and the error stri...