sockets

Connect to muliple clients asynchronously

I'm trying to write a programme to connect to a list of a dozen or so clients asynchronously using VB.NET. I'm a newb to sockets and I'm having next to no luck. More of the latter to be precise. Using this MSDN article, I would like to connect to the clients and store them in a List or Dictionary. I don't suppose anyone could help? Tha...

Socket error - sometimes???

Hey, so - I have this Socket (not XMLSocket, just Socket) client. I also have a custom PHP script on my server, that listens on port X. My client tries to connect to it. Everything works fine, the security and communication, sync and whatever else. But - the Flash Player (AIR runtime actually) shoots an error when trying to connect, bu...

.NET UDP & DTLS

Is there a native way to provide DTLS support for UDP sockets in .NET? edit by native I mean those that are in .NET framework out-of-the-box. ...

ping a server thru a specific port (fsockopen) in php

function checkServer($domain, $port=80) { global $checkTimeout, $testServer; $status = 0; $starttime = microtime(true); $file = @fsockopen ($domain, $port, $errno, $errstr, $checkTimeout); $stoptime = microtime(true); if($file) { fclose($file); $status = ($stoptime - $starttime) * 1000; $status = floor($status); } else...

Socket Programming in c

I have created small socket programs (client/server). Client will transfer all formats of files to server.The problem i am facing now is - I read mp3 file in binary mode and sent to the server. Server reads the content from the buffer and create a file.But when i am trying to open the file, it not getting open. But size remains same as o...

Does Localhost perform better on windows?

I have a .NET 3.5 server application that usually has about 8 clients. I'm using System.Net.Sockets for all the networking. I've been told that if a client is running on the same box, it should use localhost:<port> or 127.0.0.1:<port> instead of the machine's ip or name for better performance. Several people at work have said that thi...

Checking for proxy connection

What do i need to send to a proxy server (http or socks) that will tell me if it is connected to the host i specified it to connect to. ...

Python: Listen on two ports

import socket backlog = 1 #Number of queues sk_1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sk_2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) local = {"port":1433} internet = {"port":9999} sk_1.bind (('', internet["port"])) sk_1.listen(backlog) sk_2.bind (('', local["port"])) sk_2.listen(backlog) Basically, I have t...

Is there an fprintf for send?

More than likely a rookie question, but I'm looking for a printf-esque function for use in send over TCP sockets. This is for a simple chat server, specifically a modified version of the one in Beej's socket guide. I'm prepared to write my own, but before I do I want to make sure I'm not reinventing the wheel. I'm looking for something ...

problem in socket connection

I have an problem in socket connection I had client and Server application, the server application to listern an a particular port. 500 clients are to connected and send the data to process everything fine. At particular time i closed all clients and also close the server. when i start server after 10 mins at before 2 mins start all ...

c# sockets help

Hi, I'm completely new to socket programming with C#, I'm trying to get two running .exes to talk to eachother: static void Main(string[] args) { bool sender = !false; if (args.Length > 0) sender = !true; if (sender) { try { Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolT...

How to interrupt select/pselect running in QThread

I have a QThread that reads from a socket and sends a signal (QT signal) when there are any data available. This would be easy with blocking read(2), but i need to be able to stop the thread from outside without waiting for too long. If I were using pthread I would use pselect and pthread_kill(thread_id, some_signal), but QThread doesn'...

to read the packet of bytes on client(client Socket) from server(ServerSocket) using java.

hello, i m a new . i m a java developer(fresher) and currently i m working on BSE project and i m facing problem to read the packet of bytes on the client(client socket) from the server(server socket). if u can help me then please help me. Thanks in advance ...

How exactly does a Server Socket work?

How exactly does a Server Socket work? When I create a java server socket and accept connection at port 1234. Does the server actually uses the port 1234 for all clients? I've read that when you write a network server the socket actually opens another port once the connection is accepted. Is this true? If so, why am I not seeing it in n...

Chat server design of the "main" loop

Hey, I am writing on a small tcp chat server, but I am encountering some problems I can´t figure out how to solve "elegantly". Below is the code for my main loop: it does: 1.Initiates a vector with the basic event, which is flagged, when a new tcp connection is made. 2. gets this connection and pushes it back into a vector, too. Then w...

Sending Variable-Length Data Over TCP Socket

My application needs to send/receive xml data via a tcp socket. There is no way to include any kind of a fixed-length header containing message length. As far as I understand, data transmitted over tcp can come to the receipient like this. <messa ge><content >hi</content> </message> But somehow this never happens meaning that data s...

.NET two-way socket realtime communication protocoll

I need to maintain a connection between a server and multiple clients so that the clients can send commands, and the server trigger events. The server is basically a music-player, and the clients send commands like "Play()", "Pause()", "GetPlaylists()", etc. The server on it's side need to be able to tell the clients things like "SongEnd...

It is possible to figure out which internet connection is correlated with which networkInterface?

I am a noob in netoworks stuff, but I must to get to know something. When I have list o networkInterface rmnet0 eth0 lo //etc. How can I tell, which kind of connection (wifi/bluethoof/UMTS) use which networkInterface? ...

Debugging socket_select() PHP

So I'm writing a chat with a php socket server. CODE: http://pastebin.com/v5XKkfyy If i try to debug by print_r($read); just before line 75 i get this output Array ( [2] => Resource id #6 [0] => Resource id #4 ) PHP Warning: socket_select(): 6 is not a valid Socket resource in /var/www/chat/server.php on line 75 Warning:...

Connecting Java to Objective-C (using AsyncSocket)

I need to communicate between a Java app (desktop) and an iOS app. I've decided to use AsyncSocket on the iPhone side (and I've gotten data sending to work). For this question, I'm just running the EchoServer demo app on OSX 10.6.4. Source code is here. Here's my Java code, boiled-down: Socket echoSocket = new Socket("192.168.0.102...