sockets

Socket connection with coldfusion

I tried the below function.This function allows ColdFusion developers to connect to remote hosts through the TCP/IP protocol and transmit messages. Very useful for implementing chat rooms, integrate with third party applications such as merchant carts etc. <cffunction name="easySocket" access="private" returntype="any" hint="Uses Java S...

Clozure Common Lisp - TCP Socket Programming - Sending a Reply

I have a very small program which opens a socket and accepts a connection. It then grabs the remote IP and port. I'd like to send a text message to the remote computer (telnet) and close the connection. I can't determine which function is for sending a message to the telnet client. The Clozure manual lists a function called "send to" ...

UDP multicast using winsock API differences between XP and Vista

Hi, It seems to be that the implementation required to set up a UDP multicast socket has changed between windows XP and windows vista. Specifically: Under windows XP, you must call bind() before you can reference any multicast-specific socket options. However, under windows vista, you must not call bind() when dealing with multicast s...

Using multiple sockets, is non-blocking or blocking with select better?

Lets say I have a server program that can accept connections from 10 (or more) different clients. The clients send data at random which is received by the server, but it is certain that at least one client will be sending data every update. The server cannot wait for information to arrive because it has other processing to do. Aside f...

Can the data in a UDP packet be assumed to be correct at the application level?

I recall reading somewhere that if a udp actually gets to the application layer that the data can assume to be intact. Disregarding the possibility of someone in the middle sending fake packets will the data I receive in the application layer always be what was sent out? ...

AIR(Flex) local socket connection

When connecting from a local AIR/Flex application to a local application (c++) using sockets do you still need a socket policy file? If you do, is there an easy way to load the policy file without sending the policy from the local application you are trying to connect to? side note: I am writing both applications. ...

SocketTimeoutException on Solaris 9 not being thrown

I have a connection that should recieve a heartbeat every two minutes. However occasionally something happens and the network goes bad. For some reason Solaris believes that the connection is still alive, No IOException is raised locally, however one is raised remotely. I have set a timeout on the socket, and when debugged from a Windo...

Client is having trouble connecting to server using sockets?

My server is up and running (connecting through telnet worked so I know its functional) but my client cannot seem to establish a connection. I have a feeling it has something to do with the way I'm filling out the sockaddr_in serverAddr struct. Can anyone please help? Thank you. int clientSocket; char hostname[256]; struct sockaddr_i...

Where are MSG_ options defined for ruby sockets?

In the documentation for Ruby class Socket::recv, there is a mention of a second option parameter "flag" which is said to be zero or more of MSG_ options. I checked a few different sites and wasn't able to find what the MSG_ choices are. Can anyone point me to the documentation for these flags? ...

Is it a good thing for a custom rest protocol to be binary based instead of text based like Http?

Have you ever seen a good reason to create a custom binary rest protocol instead of using the basic http rest implementation? I am currently working on a service oriented architecture framework in .Net responsible for hosting and consuming services. I don't want to be based on an existing framework like Remoting or WCF, because I want t...

Aggregated throughput of multiple connections (Linux)

Why do multiple connections from the same host achieve better throughput than multiple connections from different hosts? I suspect is something kernel-related (Linux) but a confirmation would help a lot. More details I have 1 receiver process, let's call it R. It accepts incoming connections and receives data using select(). I have 3 ...

Why does my Perl sysread block when reading from a socket?

Hi all, I m doing a sysread in Perl 5.8.2 on AIX 5.3. As per the documentation, sysread is supposed to give 0 when it has read all read from filehandle. In my scenario, the filehandle is STDIN and points to a socket. So I m basically doing a sysread from a socket. But I never get 0 from sysread and it just blocks, even after client ha...

C# Socket server Ports

Hey, so I'm trying to build a simple lan game using sockets (not tcpclient or tcplistener, and yes I know they are the same thing). I managed to get the chat working, and now I'm trying to get the game to work. I read somewhere that the best way to manage the game data would be through another port on the server (if anyone can suggest a ...

C++, boost asio, receive null terminated string

Hi, How can I retrieve null-terminated string from socket using boost::asio library? Thanks in advance ...

Need a workaround: Python's select.select() doesn't work with subprocess' stdout?

From within my master python program, I am spawning a child program with this code: child = subprocess.Popen(..., stdout=subprocess.PIPE, stdin=subprocess.PIPE) FWIW, the child is a PHP script which needs to communicate back and forth with the python program. The master python program actually needs to listen for communication from s...

Send serialised object via socket

Whats the best way to format a message to a server, at moment I'm serilising an object using the binaryformatter and then sending it to the server. At the server end its listening in an async fashion and then when the buffer size recieved is not 100% it assumes that the transfer has complete. This is working and the moment, and I can d...

Reading from sockets and download speed

Just for fun, I develop a download manager and I'd like to know if reading a large stack of data (i.e. 80 or 100KB) from a socket over the net makes the download speed higher, instead of reading 4KB for each loop iteration? (My average download speed is 200KBPS when I download a file with firefox for example) Thanks, Nir Tayeb. ...

Server design using SocketAsyncEventArgs

I want to create a asynchrone socket Server using the SocketAsyncEventArgs event. The server should manage about 1000 connections at the same time. What is the best way to handle the logic for each packet? The Server design is based on this MSDN example, so every socket will have his own SocketAsyncEventArgs for receiving data. Do t...

Importance of ping - pong in udp p2p communication

I am quite new to socket programming. I was trying to make p2p communication using udp and did finally made it. While writing a program, the point I have observed is that communication between two peers does not take place if packets are not send from both sides. I read somewhere that in networking its called ping-pong. I want to know ...

C# UDP decoding datagrams fails randomly

Hi, I'm experiencing an issue in a multi threaded application and have been debugging it for the last 3 days but for the life of it can not figure it out. I'm writing this, hoping that I either have a DUH moment when typing this or somebody sees something obvious in the code snippets I provide. Here's what's going on: I've been working...