sockets

Implementing ICMP ping in Go

Is it possible to implement an ICMP ping in Go? The alternative is to fork a 'ping' process, but I'd rather write it in Go. ...

Polling versus socket servers for online Flash games

Hi, I want to make an online flash game, it will have social features but the gameplay will be primarily single-player. For example, no two players will appear on the screen at once, the social interaction will be through asynchronous messages, there won't be real-time chat or anything. Much of the logic would happen in the client, the...

Dns caching for sockets

I'm connecting to some websites through socks proxy server. In my case its very good to implement dns cache, so proxy don't need to resolve website's ip address. So, I performed DNS lookup, but don't know where to supply IP address. mySocket.Connect uses proxy's ip address so it isn't right place. I tried to place it in http header GET h...

Udp server sending only 0 bytes of data

Hi all, This is a simple Udp server.I am trying to transmit data to some clients,but unfortunetly it is unable to transmit data.Though send is running quite successfully but it is returning with a return value meaning it has send nothing.On the client they are receiving but again obviously,zero bytes. void* UdpServerStreamToClients(v...

Can cometchat be used with socialengine 3.xxx while it stays on a different server

Hi, Is there a way to use cometchat with socialengine while we keep the ajax scripts handling chat requests on another data and still integrate it to the Socialengie3.xx Also if cometchat can support a socks server please let me know if yes which sever? -- Usman ...

How to handle activity life cycle involving sockets in Android?

Hello all, I have an Android activity which in turn starts a thread. In the thread I open a persistent TCP socket connection. When the socket connects to the server dynamic data is downloaded. The thread sends messages using Handler-class to the activity when data has been received. Now if the user happens to switch from portrait to...

PHP miniwebsever file download

$httpsock = @socket_create_listen("9090"); if (!$httpsock) { print "Socket creation failed!\n"; exit; } while (1) { $client = socket_accept($httpsock); $input = trim(socket_read ($client, 4096)); $input = explode(" ", $input); $input = $input[1]; $fileinfo = pathinfo($input); switch ($fileinfo[...

Sending while receiving in C

I've made a piece of code in what's on my server as multiple threads The problem is that it doesn't send data while im receiving on the other socket. so if i send something from to client 1 to client 2, client2 only receives if he sends something himself(jumps out of the recv function) .. how can i solve this ? /* Thread*/ while (! ...

recv with MSG_NONBLOCK and MSG_WAITALL

Hello I want to use recv syscall with nonblocking flags MSG_NONBLOCK. But with this flag syscall can return before full request is satisfied. So, can I add MSG_WAITALL flag? Will it be nonblocking? or how should I rewrite blocking recv into the loop with nonblocking recv ...

fwrite() not writing. Error with my code, or the remote client?

Trying to set up a script to send commands to a remote client on a Win32 system. Here is the code: $command = $_POST['command']; $host = $_POST['host']; $port = $_POST['port']; $fp = @fsockopen($host, $port, $e, $s, 15); if (!$fp) { echo 'Error! Here\'s your problem: ' . $e . ': ' . $s; }else{ $fw = fwrite($fp, $command); ...

Socket in multiple threads

I have a project where Thread A calls Accept(...) on some socket, then it passes it to another thread, which does receive on the socket and then closes the socket. The object on which accept was called is never closed in Thread A. Is that safe? What happens to that object in Thread A? ...

python sending incomplete data over socket

I have this socket server script, import SocketServer import shelve import zlib class MyTCPHandler(SocketServer.BaseRequestHandler): def handle(self): self.words = shelve.open('/home/tipu/Dropbox/dev/workspace/search/words.db', 'r'); self.tweets = shelve.open('/home/tipu/Dropbox/dev/workspace/search...

How to migrate existing udp application to raw sockets

Hello Is there a tutorial for migration from plain udp sockets (linux, C99/C++, recv syscall is used) to the raw sockets? According to http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch03s04.html raw socket is much faster than udp. Application is client-server. client is proprietary and must use exactly same procotol as it was with u...

How to receive HTTP messages using Socket

I'm using Socket class for my web client. I can't use HttpWebRequest since it doesn't support socks proxies. So I have to parse headers and handle chunked encoding by myself. The most difficult thing for me is to determine length of content so I have to read it byte-by-byte. First I have to use ReadByte() to find last header ("\r\n\r\n" ...

EWS Managed API: Only one usage of each socket address (protocol/network address/port) is normally permitted

We're developing software that allows our custom scheduling application (master role) to synchronize with Microsoft Exchange Server 2010/2007 (slave role). Our solution is based on .NET 4.0, the EWS Managed API and Parallel Fx, and of course our own C# code. We've taken special care of the fact that "ExchangeService" class instances are ...

AS3 / Java - Socket Connection from live Flash to local java

Hey guys, I'm trying to get a live flash that lives on a webserver to talk to a local java server, that will live on the clients PC. I'm trying to achieve this with a socket connection. (port 6000) Now, at first flash was able to connect, but it just sends <policy-file-request/>. After this nothing happens. Now, some people at Kirupa...

Working with sockets in MFC

I'm trying to make a MFC application(client) that connects to a server on ("localhost",port 1234), the server replies to the client and the client reads from the server's response. The server is able to receive the data from the client and it sends the reply back to the socket from where it received it, but I am unable to read the reply...

Linux: Finer-grain control of INET listen socket binding?

I have interfaces lo, eth0, and eth0:1. progA creates a listen socket, and binds it to port p on INADDR_ANY. Simultaneously, I would like to use ncat to port forward, listening on the same port p, but only on the IP address associated with eth0:1. As expected, ncat is failing with "address already in use". What I would like to b...

Client Server Communication Using Sockets

What's the easiest way to send a message to a server and read the response it gives you in a non-blocking way ? (using sockets and mfc maybe) ...

Using sys/socket.h functions on windows

Hello, I'm attempting to utilize the socket.h functions within Windows. Essentially, I'm currently looking at the sample code at http://beej.us/guide/bgnet/output/html/multipage/clientserver.html#datagram. I understand that socket.h is a Unix function -- is there anyway I can easily emulate that environment while compiling this sample c...