sockets

observing on-off socket problem

hi, guys, recently I encounter a problem. I am using two programs A and B, developed by someone else, which use TCP sockets to communicate each other, A is server, B is client. That is what I observed: when I start both A and B, they run and communicate with each other, if I first kill A, then restart A again, now by checking the proces...

How to find out if a socket is already in Non-Blocking mode in Windows?

Is there a way to find out if a socket is already in Non-Blocking mode in Windows? I know this can be done in case of Linux, but, I am unable to find any way for this Windows. All my coding is in 'C' language. Is there a way? ...

sending sokect data to JMF player.

hey guys I have written a video player in JMF. I can successfully read a local file on my system and play it in the player. But now I have to use the socket video data which is received in buffer...! and pass this buffered data to the player... I have searched the web for long but I cudnt find how to pass the buffered data to the playe...

How can I hold a SMTP connectio open with smtplib and Python?

Hi there, I need to check the timeout of a SMTP-Server, but my socket just closes. What am I doing wrong? Here is my test for it: #!/usr/bin/python import smtplib import time import datetime import socket socket.setdefaulttimeout(1800) now = time.time() server = smtplib.SMTP() server.set_debuglevel(1) server.connect('mx.foo.bar','25'...

Looking for a simplest (and fastest) example of TCP socket programming for windows, c or c++

Hi, I'm looking for a simplest (and fastest) example of TCP socket programming for windows, c or c++, whichever can get it accomplished faster, sending trival data, for example 1 byte, or several bytes, but in one packet. It's for research purposes. I googled and found several examples, however every single of out them looks a bit dif...

Connecting to a Socket from Android application

Hi I am developing an android application where i need to connect to a server socket from my application. The application works fine when i am at home and my android phone and the server using the same Wi-Fi. However, when I am at the university my application can not connect to the server socket. It always shows "The Operation has time...

Ruby TCPSocket: Find out how much data is available

Is there a way to find out how many bytes of data is available on an TCPSocket in Ruby? I.e. how many bytes can be ready without blocking? ...

socket never accept bytes to write

Hi, I'm trying to write a client. I am able to open a socket to the server and the server acknowledges the connection, but for some reason, the write stream is never ready to accept data, i.e. it seems to always be blocked. What am I doing wrong? I'm new to socket programming, so it might be something in the wrong place, but here's w...

Multi threaded client server

Hi I am working on an assignment writing multi threaded client server. So far I have done is open a socket in a port and forked two thread for listening and writing to client. But I need to connect two type of clients to the server and service them differently. My question is what would be my best approach? I am handling connection in a...

How to stop Socket.BeginRecieve()

Ok My chat application when successfully set up, both server and clients start their Socket .beginrecieve() operation and listens throughout thier runtime. private void Accept(IAsyncResult iar) { Socket winsock = (Socket)iar.AsyncState; g_server_conn = winsock.EndAccept(iar); //Function that exchanges...

WinSock error occured while downloading mail message as MSG file

My environments are Server Machine: DocuShare Server 6 Client Machine: Windows XP where DocuShare client 6, DocuShare outlook client 3, MS outlook 2007 and our C# application are installed. We have a C# application to download mail message from DocuShare server using DocuShare API. The application successfully downloads docushare mai...

What is the difference between GCD Dispatch Sources and select() ?

I've been writing some code that replaces some existing: while(runEventLoop){ if(select(openSockets, readFDS, writeFDS, errFDS, timeout) > 0){ // check file descriptors for activity and dispatch events based on same } } socket reading code. I'd like to change this to use a GCD queue, so that I can pop events on to the queue...

Using python sockets to receive large http requests

I am using python sockets to receive web style and soap requests. The code I have is import socket svrsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = socket.gethostname(); svrsocket.bind((host,8091)) svrsocket.listen(1) clientSocket, clientAddress = svrsocket.accept() message = clientSocket.recv(4096) Some of the soa...

UDP sockets in iPhone background

My iPhone application is using AsyncUdpSocket to handle a UDP socket.But when my application goes background in iOs 4.0 and return back, i am getting following error. Application 'MyAppName' exited abnormally with signal 13: Broken pipe This is because my sockets are disconnected when my application goes to background. How to run ...

How to connect properly to an Optivote device through a local socket connection?

Optivote IR8 is basically a voting system with a bunch of remote controllers, which can send IR signals to a receiver, which is connected to a computer through a USB port. And I'm trying to write my own little software for that with Flash. Optivote receiver communicates with software through a virtual serial port. When I connect to that...

Terminate a sockert.recv in a thread in Python

Hello, To implement a simple protocol in python, I've used a thread to monitor acknowledgements send by the receiver. To do this, I use a thread in a function def ackListener(self): while self.waitingforack: ack = self.socket_agent.recv(4) ... exit() where self.waitingforack is a boolean I set to False when I...

How does linux file descriptor limits work?

I was told that my server refused to accept client network connections at a specific port could be due to the lack of file descriptors. I looked up what this is all about and read about it here: http://www.netadmintools.com/art295.html So I tested my system and I got this: cat /proc/sys/fs/file-nr 1088 0 331287 What does this m...

Get network tracing information without enabling tracing

I'm writing a little proxy server, and I'm trying to debug a problem. If I refresh the browser twice quickly, my proxy throws an exception, usually with no stack trace or indication of where the problem is. I have a hunch it has to do with a socket being closed prematurely by the browser, or being used for two different requests in my pr...

Error #1009 when trying to send a byte to a socket in action script 3?

I'v been looking and I can't seem to figure this out below is my code. import flash.net.Socket; var mySocket = new Socket mySocket.connect("127.0.0.1", 5331) var sym:SimpleButton; sym.addEventListener(MouseEvent.MOUSE_DOWN, symbtn); function symbtn(event:MouseEvent):void { mySocket.writeUTFBytes(1); } ...

php passing c struct data throught socket programming

Dear All, How to make a php socket client that needs to perform socket_sendto to linux C socket server which has following struct typedef struct { UI2 todo; char rz[LNG_RZ + 1]; char saId[LNG_SAT_ID + 1]; char user[LNG_USER + 1]; char lang[LANGLEN + 1]; SI4 ...