sockets

Heartbeat Protocols/Algorithms or best practices

Recently I've added some load-balancing capabilities to a piece of software that I wrote. It is a networked application that does some data crunching based on input coming from a SQL database. Since the crunching can be pretty intensive I've added the capability to have multiple instances of this application running on different servers ...

how to differentiate if client is using TCP or UDP from server side

I am writing simple client-server program. Client send some messages to server using UDP or TCP. Server must be able to support both UDP and TCP. If client, sends message using UDP, sequence of method calls in client is socket(),bind(),sendto(),recvfrom(),close() and that in server is socket(),bind(),sendto(),recvfrom(),close(). If it...

client-server program, problem sending message from client to server and viceversa using TCP

Hi, I have a small program that sends and receives data from server and client and vice-versa. Everything works fine, but I can't see received messages in both sides and it is always 0 bytes. It doesn't give any compile error but doesnt work the way I wanted to. Can you please have a look at this, where I am doing wrong ? Thanks // clie...

Calculate server requirements based on programming specs

Have you ever encountered something so easy to develop but stopped a while to think of server requirements for your project ? It is my case. I want to compete with a gaming site, they have multiplayer Flash games like poker, rummy, backgammon, and other card games, 8 games in total. For each game they have rooms and tables. I'll use Sil...

Error trying to pass (large) image over socket in python ..

I am trying to pass an image over python socket for smaller images it works fine but for larger images it gives error as socket.error: [Errno 10040] A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itse...

Python SOCK_STREAM over internet ...

I have a simple programs for socket client and server its not working over internet # Echo server program import socket import ImageGrab HOST = '' # Symbolic name meaning all available interfaces PORT = 3000 # Arbitrary non-privileged port s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, ...

Testing for writability of BSD socket in Cocoa.

I have a BSD socket created with following code (it's in external library that I cannot change): fcntl(sock, F_SETFL, O_NONBLOCK); connect(sock, (struct sockaddr*) &sin, sizeof(sin)) What I can do to get a notification from Cocoa that connection is established? In regular world I would make select(3) and test for writability but this ...

TCP server (php)

I have a gps simulator, which sends continuous location data (nmea strings) through tcpip to 192.168.0.178:2323. How do I get that data using tcp socket and write to DB (php & mysql)? Thanks! ...

How does the HTML5 Web Sockets Interface work?

I heard about the Web Sockets Interface in the HTML file specification from a relevant question here. It sounds very promising! I don't understand how it works does it still use the HTTP protocol and works-around it or does it work something like TCP sockets? ...

How to stream binary data in python ..

I want to stream a binary data using python. I do not have any idea how to achieve it. I did created python socket program using SOCK_DGRAM. Problem with SOCK_STREAM is that it does not work over internet as our isp dont allow tcp server socket. I want to transmit screen shots periodically to remote computer. I have an idea of maintai...

How to send and receive serialized object in socket channel

I want to transmit a serialized object over a socket channel. I want make "Hi friend" string as serialized object and then write this object in socket channel while in the other end i want to read the same object and retrieve the data. All these things I want to do using Java SocketChannel. How to do this? I have tried like below, but d...

Secure two-way communication between client and server including large file attachments

In .net, I need to securely transfer files 4mb in size from client machines running my software to a central server, process, and securely send back results consisting of a pdf file, a jpg image, and xml data. What .net technology would be most appropriate for this? (web service. remoting, etc) ...

Which programming language is more suitable for socket programming?

I will have a cloud computing class this semester, and one of the requirements about the course to know about socket programming. First thing that I came up in my mind for this question was Java. I know Java has a strong socket programming library; but I anyway want to ask your opinion. What do you guys think? ...

Java sockets and TCP tuning

Hello, I try to develop a file transfer application in Java, with an applet as client, and a standalone java app as server (on a dedicated machine hosted in a datacenter). I use DataOutputStream/DataInputStream to transfers the data on both sides. When I send big volumes of data, the bandwith is very variable : all is okay first, then t...

Could not get out of python loop ...

I want to get out of loop when there is no data but loop seems to be stopping at recvfrom image='' while 1: data,address=self.socket.recvfrom(512) if data is None:break image=image+data count=count+1 print str(count)+' packets received...' ...

Is it safe to issue blocking write() calls on the same TCP socket from multiple threads?

Let's say I have two threads, T1 and T2. Thread T1 makes a blocking write() call on a TCP socket S to send a large buffer of bytes B1. The buffer of bytes B1 is so large that (a) the write call blocks and (b) TCP has to use multiple segments to send the buffer. Thread T2 also makes a blocking write() call on the same TCP socket S to se...

Python socket programming and ISO-OSI model...

Hello , I am sending packets from one pc to other. I am using python socket socket.socket(socket.AF_INET, socket.SOCK_DGRAM ). Do we need to take care of order in which packets are received ? In ISO-OSI model layers below transport layer handle all packets communication. Do all ISO-OSI layers present in the program ? Or some of them pr...

Windows Mobile Sockets SSL Communication library

I have a Win32 application that uses boost::asio and openssl library but it seems that they are not supported under WM, am I correct? Can anyone suggest WM API/library for WM Sockets, I need to connect to a server through SSL connection. Is the only option for me WinSocks + OpenSSL? ...

java.net.SocketException: Software caused connection abort: recv failed; Causes and cures?

Hi, all. I've got an application running on Apache Tomcat 5.5 on a Win2k3 VM. The application serves up XML to be consumed by some telephony appliances as part of our IVR infrastructure. The application, in turn, receives its information from a handful of SOAP services. This morning, the SOAP services were timing out intermittently, ...

Is it possible to fake blocking Connect with Silverlight sockets?

Hi, In Silverlight all socket calls are restricted to being Async - I have an API which I share between .NET and Silverlight and its based around blocking socket calls. Is there any way to fake or wrap the async socket calls in Silverlight to make them behave like blocking sockets? ...