sockets

PHP To Perl Socket Communication

So far I have written a Perl server that runs constantly in the background, when it receives inbound connections a process is forked and that then handles that one connection. What I ultimately want it to be able to do is accept inbound php connections through the socket of course run these commands and then relay and information back. S...

What is the best script language for n/w programming + web development

Hi, I'm interested in developing web application and networking application. For that what is the best script language to learn. Which one is effective for this two. So for, i don't know even a single syntax of any scripting language. Which is the best script for understanding, maintainable, effective and simple (may not). Please d...

Opening a socket over a RS232 connection

Hi, I have a 'C# server' program listening to '127.0.0.1', port 5500, using .NET socket, and i have a corresponding C# client program sending messages to this socket from the same PC. They both work fine. Now if i run the 'client' and 'server' programs on seperate PC's and connect them via a cable connecting their serial ports (RS232)...

Can UDP (unicast client) recvfrom() other servers other than the one sendto()?

I am creating a UDP socket client in C (unicast) and is wondering why recvfrom() has a struct sockaddr * argument in which in the man page says, A null pointer, or points to a sockaddr structure in which the sending address is to be stored. Is it possible that I could receive a message from a different server other than the one I sen...

Is it possible to increase then QUEUESIZE for Perl's socket listen?

The typical socket code for Perl goes like this: bind(Server, sockaddr_in($port, INADDR_ANY)) || die "bind: $!"; listen(Server,SOMAXCONN) || die "listen: $!"; As described in this page the actual maximum allowed is somewhere around 5. That's way too low! I'm using a unix domain file socket and expecting very high throughput. ...

How to buffer data for send() and select()?

While a send() succeeds with all data being sent most of the time, it is not always the case. Thus people are advised to use the write-fdset for select() and poll() to check when the socket is writeable. How do usual mechanisms look like to actually buffer the data to send while still maintaining a well comprehensible sourcecode? ...

C# NetworkStream.Read()

I'd like to empty read buffer of the socket so I wrote follow code... byte[] tempBuffer = new byte[1024]; int readCount = 0; while ((readCount = tcpSocket.GetStream().Read(tempBuffer, 0, tempBuffer.Length)) != 0) { // do with tempBuffer } But Read() method is blocked so I added tcpSocket.ReceiveTimeout = 1;. And it works just like...

Create a simple POP3 *SERVER*

There are tons of Google examples on making a POP3 client in .net but I want to make a simple custom POP3 service/server to retrieve email for the user from a custom database. Are there any components or examples of that? ...

I'd like to port simple C++ echo server to C#

SOCKET client = accept(listen_sock, 0, 0); timeval client_to; client_to.tv_sec = 1; client_to.tv_usec = 0; setsockopt(client, SOL_SOCKET, SO_RCVTIMEO, (char*)&client_to, sizeof(client_to)); char buffer[1024]; while ((ret = recv(client, buffer, 1024, 0)) != 0) { cout << "<in loop>" << endl; if (ret == -1 && WSAGetLastErr...

10035 error on a blocking socket

Does anyone have any idea what could cause a 10035 error (EWOULDBLOCK) when reading on a blocking socket with a timeout? This is under Windows XP using the .NET framework version 3.5 socket library. I've never managed to get this myself, but one of my colleagues is getting it all the time. He's sending reasonably large amounts of data to...

Missed Socket Message

I have been doing socket programming for many years, but I have never had a missed message using TCP - until now. I have a java server and a client in C - both on the localhost. They are sending short message back and forth as strings, with some delays in between. I have one particular case where a message never arrives on the client...

ip address blocking..

I have one server and client application using socket programming in c#. In this, max. 10 clients can be connected to the server at a time. But my requirement is that I have to block one of the clients via IP address when i'm sending messages through server.. Please help with blocking. The program is given below.. using System; using Sy...

C# Socket.Connected property is changed to false after calling Socket.Receive

int readCount; byte[] buffer = new byte[128]; SocketError socketError; TcpClient tcpClient = tcpListener.AcceptTcpClient(); tcpClient.Client.ReceiveTimeout = 500; // #1 // tcpClient.Client.Connected is **true** here. readCount = tcpClient.Client.Receive(buffer, 0, buffer.Length, SocketFlags.None, out socketError); // reacCount > 0 // tc...

Is the select() wrapper in IO::Select thread-safe? How to work around?

Let's say I have a thread: sub new { my $class = shift; my $self = ref $class || $class; bless { 'read_set' => IO::Select->new, 'write_set' => IO::Select->new, 'error_set' => IO::Select->new }, $self; } sub start { my $self = shift; $self...

How do I enable more handshake ciphers in CFStream?

When running the method: CFReadStreamSetProperty(theReadStream, kCFStreamPropertySSLSettings (CFDictionaryRef)tlsPacket->tlsSettings); To secure the connection of a CFReadStream, my iphone client returns the error: Error Domain=kCFStreamErrorDomainSSL Code=-9824 "Operation could not be completed. (kCFStreamErrorDomainSSL error -9824...

how to compare ip addresses

How to compare IP Address that is stored in an array of Ip[0] with remote Endpoint?? Please Help me. ...

Block Ip Address

How to block one IP Address that is connected to the server, when the server is sending messages. My Sending message option program is shown below. private void buttonSendMsg_Click(object sender, EventArgs e) { try { Object objData = richTextBoxSendMsg.Text; byData = System.Text.Encoding....

Socket error 10052 on UDP socket

We have a .NET 2.0 desktop application which sends and receives network packets over UDP. Several users have reported an occasional socket error 10052 which happens when the code calls socket.BeginReceiveFrom on a the UDP socket. What does this mean? The official MS documentation for socket error 10052 says - quote: "WSAENETRESET (100...

How to test Berkley socket (BSD) API?

I'd like to test the correctness and the completeness of an implementation of the BSP API. The test set has to be cross-compiled for an ARM sam7x. ...

Sql Server 2005 executing exe on remote machine or connect to server application

Hello, I'm try to figure how to create sql server stored procedure that when a condition is met executes an executable, with command line arguments, on a remote machine within the network. I could write my own little server application to handle the communication sent from the stored procedure for the executable, but I'm not certain ...