Hi guys,
I have a problem - I don't know the amount of data being sent to my UDP server.
The current code is this - testing in irb:
require 'sockets'
sock = UDPSocket.new
sock.bind('0.0.0.0',41588)
sock.read # Returns nothing
sock.recvfrom(1024) # Requires length of data to be read - I don't know this
I could set recvfrom to 65535 ...
Hi programmers,
does anybody of you know some code snippets on opening an CFSOCKET and sending a two byte sequence via TCP/IP to a WLAN module, which is programmed to serialnet, listening on PORT 5100, the IP-address of the modul is: 192.168.100.1. I try to get those two bytes out of a UART of the WLAN module.
I have bought "pTerm" and...
Scenario:
I try to post a video to YouTube with the following code:
YouTubeEntry createdEntry = service.Upload(newEntry);
This works fine on my developer machine (running Windows XP).
It fails on a Win2k server (running .NET 2.0) with the following error:
2010-07-15||01:14:08 PM||An established connection was aborted by the software...
Is there a way in PHP use a HTML form to upload only the header of the file. The length of the header is defined within the first few bytes of the file, I want only that part nothing else. After I have received the last byte of the header, I don't want any more of the file. Is there a graceful way to do this in PHP or am I going to have ...
I'm using ActionScript to connect to a C# socket server.
In the client (ActionScript), I use the following to send data:
var socket:Socket = new Socket("localhost", 8080);
socket.writeUTF("hello");
socket.flush();
In the server (C# 4.0), I use this:
server = new TcpListener(IPAddress.Any, 8080);
server.Start();
TcpClient client = ser...
I've got a laptop and a desktop, both running Ubuntu 10.04, both running the stock Python 2.6.5 that comes with Ubuntu.
On the laptop, the following program
#!/usr/bin/env python
import socket
print(socket.getaddrinfo("localhost", 8025, 0, socket.SOCK_STREAM))
works -- i.e., it prints out some stuff without getting an error.
The stu...
I'm trying to serialize objects to send over network through a socket using only STL. I'm not finding a way to keep objects' structure to be deserialized in the other host. I tried converting to string, to char* and I've spent a long time search tutorial, posts in internet and until now I found nothing.
Is there a way to do it only with...
I want to write a simple server application that will take commands from a client application and run those commands in separate threads.
I was looking at the server class in dlib. Does anyone have experience using this? How does it compare to using Boost's Asio?
Example of server in dlib
Examples of client/server in Boost Asio
...
Hi
I want to know if SO_REUSEPORT option is enabled in LINUX 2.6 or not ??
If I try to use it and compile my code I get following error
01.c:72: error: `SO_REUSEPORT' undeclared (first use in this function)
01.c:72: error: (Each undeclared identifier is reported only once
01.c:72: error: for each function it appears in.)
Using the a...
Below is partial code to an experimental http server app I'm building from scratch from a PHP CLI script (Why? Because I have too much time on my hands). The example below more closely matches PHP's manual page on this function. The problem I'm getting is when connecting to this server app via a browser (Firefox or IE8 from two separat...
I have a simple SMTP client, to which I am attempting to add TLS support. I am unsure as to what occurs after the client issues the 'STARTTLS' command. Most sources (including the RFC itself) describe it as the negotiation of a TLS session, but this is not particularly clear.
How does one go about doing this? My client is written in ...
I hit a bug in my code which uses WSARecv and WSAGetOverlapped result on an overlapped socket. Under heavy load, WSAGetOverlapped returns with WSASYSCALLFAILURE ('A system call that should never fail has failed') and my TCP stream is out of sync afterwards, causing mayhem in the upper levels of my program.
So far I have not been able to...
Hi All
I am trying to write in Linnux a client in C++ using boost::asio data from a socket. The server is built in Java. The issue I have now is that I cannot read correctly some piece of information from the socket. If the client is done in JAVA everything is ok.
In details the big error I have are in receiving the unsigned long and t...
I'm running Fedora 13 if that matters.
I looked up man pages on unix(7), setsockopt, and send/recv.
Reading the man pages seems to more or less tell me that not all options are guaranteed to do ANYTHING... and apparently only a few that do/don't work are actually documented.
In particular... I wanted to see if timeouts were possible. ...
I understand that the following code can (perhaps not very efficiently) find out a free TCP port in Java:
public static int findFreePort() {
int port;
try {
ServerSocket socket= new ServerSocket(0);
port = socket.getLocalPort();
socket.close();
} catch (Exception e) { port = -1; }
return port;
...
I'm writing a very small and simple server that I want to listen on multiple ports.
I'm using the below, but connections to port 8081 are not being accepted - any suggestions what I'm doing wrong?
(I actually want to listen on multiple ports, I'm not confusing multiple connections)
Public Sub StartServer()
Dim ports() As Integer...
Hello all,
I am developing a chat module for drupal. I plan to provide multiple backends for chat message processing. I initially started with AJAX and have now included long polling technique in it. Then I came across ape(ajax push engine) and it looks promising. But it will require server side installation of ape for the chat module t...
I'm working on some software that consists of a server and clients on one machine that communicate via local sockets.
The server (written in Java) opens a java.net.ServerSocket on port 9000, and the clients (in either Java or Python) have to connect to localhost:9000 to communicate.
In Windows and Linux, this works fine. On Mac OS X (...
Hi
I am trying out a udpclient program which uses sendto and recvfrom functions. I am setting SO_RCVTIMEO value as 10 seconds for my socket.
I am binding the socket to source ipaddress and sourceport. When I check the netstat I can see that there is no other process which is binded with the same values. My bind operation is also succe...
I am trying to communicate between two android emulators for communication , thus I am trying to forward port X to port Y on 127.0.0.1 where port X is the port I am transmitting too and Y is the one I am receiving . Is this possible and if so how do I forward the local ports?
...