sockets

Receiving an entire UDP packet

I am programming a UDP proxy application for Windows in C++ that sends and receives UDP packets with Winsock. The problem is that I need to work with the ENTIRE packet, not just the data and UDP and/or IP header. I have tried raw sockets with IP_HDRINCL (might be misspelled), but it still chops off some information from the packet. Is th...

Job asks for J2SE skill but working on server-side

I am gonna have an interview with a company working on stock trading system which only requires core Java skill. However, the requirements list many server related stuff as follow: Strong server-side Java (no UI) Strong JUnit testing Web service knowledge, HTTP / HTTPS Lucene Performance tuning experience will be desirable Continuous i...

Socket Communication - StreamCorruptedException(Jboss Remoting)

Hi All, I am using EJB3 as the client socket and the server socket is a normal java class. My Application server is Sun GlassfishV2. I would like to communicate from the EJBBean(Client) to the server using Jboss Remoting. If I use transport protocol "sslsocket" in the InvokerLocator class means its working fine. But If I use the transpo...

How do I handle this pointer in getaddrinfo?

Warning: Please treat me like the rookie I am. This is my first "real" C program. So if I don't understand some things, that's why. I'm trying to make a chat server following the example from Beej's Guide to Network Programming. It came recommended, so there you go. I want to have a function accept a pointer to a structure, modify prop...

C# asynchronous socket Begin/EndReceive questions

I've implemented a async funtion in order to read large socket data, mostly files will be transferred. Code is based on this question: public class StateObject { public Socket workSocket = null; public const int BUFFER_SIZE = 1024; public byte[] buffer = new byte[BUFFER_SIZE]; public StringBuilder sb = new StringBuilder(); } public st...

java.net.ConnectException - Connection Refused Android Emulator

I have an android emulator I'm running from eclipse and just trying to connect to a simple socket server I wrote in .NET (c#). The server is running on the same machine on port 4505. I am able to telnet (through PuTTy) to the server and it works just fine, but when I try to connect to the server with the android emulator I get a: java....

Socket operation errors with MATLAB and the Parallel Computing Toolbox

We're using the MATLAB Parallel Computing Toolbox for one of our projects and we intermittently get the following error: The client lost connection to lab 2. This might be due to network problems, or the pmode parallel job might have errored. This is causing: java.io.IOException: An operation on a socket could not be performed because t...

Nice book/tutorial about using UDP in objective c?

Hey, I wanna make a MMORPG, I'm now working on the multiplayer. The client is iOS device, so I'll use objective c on the server too. I'm googling for hours and can't find a nice tutorial to use the UDP for begginers. Also is obj-c on the server is a good idea? Oh, and other thing.. What is "Socket"? Thanks! ...

C# ==> Asyncsocket reading buffer?

I have a C# server that accepts multiple clients, and multiple messages from each client. 1- In order to start reading from each client i need to pass a buffer (bytes), but the problem is I don't know how much data is the client is going to send. So is there a way to know how much data a client is going to send so that i can start readi...

How to read java stream until certain byte is reached

My question is similar to this post. But I don't send packet length rather a 0 byte at end. http://stackoverflow.com/questions/833744/most-efficient-way-to-read-in-a-tcp-stream-in-java So I'm wondering how would I code something that would. At the moment I just use this.socketIn = new BufferedReader(new InputStreamReader(this.socket....

socket client for android - best methods

I have a few questions about creating a socket client for android devices. 1) what is the best object/method to use to handle the socket.getInputStream() method. I've seen a few different ideas and before I start playing around with them, I'd like to hear it here first as to what you all think the best approach to handling the InputStr...

Is HTML5 advanced enough to be used for a socket based application?

Is it possible to create a socket based multi-player game client using html5? Does html5 allow socket programming? ...

java hijack socket possible?

Hi, I suddenly find myself wondering this question, is it possible in java to hijack a socket? say a server is listening on port 5000, would it be possible to write a java programme to listen on port 5000, and forward the same data to the server via port 5000. What would be involved in doing this? I feel this involves writing a new net...

How to set the Don't Fragment (IP_DF) flag in C

I want to set the Don't Fragment flag on a IP packet. Is there a way to do so via the setsockopt() function or via the flags of the sendto() function? Can I do this with "normal" sockets or do i have to use raw sockets and build the entire IP header myself, setting it's offset-field to IP_DF (which is defined in ip.h)? ...

recvfrom stuck on one interface

hi, I'm using recvfrom to receive muticast messages from the network. There are two network interfaces on the system and recvfrom only receives from the first interface. When the 2nd interface is functional, recvfrom is blocked indefinitely and only receives a packet after switching to the 1st interface. SO_REUSEADDR is used in set optio...

C# Socket BeginReceive / EndReceive capturing multiple messages.

Problem: When I do something like this: for (int i = 0; i < 100; i++) { SendMessage( sometSocket, i.ToString()); Thread.Sleep(250); // works with this, doesn't work without } With or without the sleep the server logs sending of separate messages. However without the sleep the client ends up receiving multiple messages in sin...

Implementing timer using select

I am planning to write a small timer library in C using timerfd_create. The basic user of this library will have two threads application thread Timer thread There will be a queue between these two threads so that whenever the application wants to start a timer, it will push a message into the queue which the timer thread will then ...

Using Winsock "send" function in Java (or similar)

Hi all, I have a feeling my problem is a bit strange, but here goes... I have a C++ program (from another organization) that interacts with a camera connected to hardware via Ethernet using sockets. On the surface, the initial function that sends a message to the socket is this: char* cmd = "#TRGON\x0d"; m_pClient->Socket_Write( (BYTE*...

Is a single Java thread better than multiple threading in my scenario?

Our company is running a Java application (on a single CPU Windows server) to read data from a TCP/IP socket and check for specific criteria (using regular expressions) and if a match is found, then store the data in a MySQL database. The data is huge and is read at a rate of 800 records/second and about 70% of the records will be matchi...

Socket Programming in C++

Hi, Can anybody provide me some sample example on Client and server connection using sockets in C++. I have gone through some tutorials now i want to implement it. How to start ? ...