I am building a socketserver using Apache Mina and I am trying to make sense of configuring the thread model. I am currently reading:
http://mina.apache.org/configuring-thread-model.html
As I understand it; it is best to use multithreading for each IOService, something like:
SocketAcceptor acceptor = new SocketAcceptor(
Runtime...
Hi guys,
Here is a scenario with asynchronous sockets that I dont't quite understand... I have 2 Tcp sockets, a client socket & a server socket. My server socket is bound & listening on a port.
My client sockets connect to the server socket (using BeginConnect / EndConnect). I then send a message to the server using BeginSend(). ...
Hi, as object i'm tring to create a client and server scripts in order to send and receive multicast packages over IPv6. In IPv4 everything work as well, but i cannot figure out how to change it in IPv6.
I start as basis from Multicasting In Ruby but seems ff12::3422 isnt good for MULTICAST_ADDR as others i already try to assign.
Than...
I'm making an outbound connection using a DNS name to a server other than the localhost, and I get this exception:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
127.0.0.1:5555
The text implies that the T...
Does Socket.Bind be necessary for every situation?
If no, what are the situation in which Socket.Bind must be used?
Any help? Thanks.
...
under what conditions a socket is ready for reading and writing?
...
I am writing a C program in Unix System Services on a z/OS mainframe. One of the requirements is to get a sequence number from a DB2 database residing on the same mainframe. Not having DB2 Connect available, I'm wondering what my options might be. I can open a socket on port 50000 (the default DB2 port), but, from the IBM documentation I...
Hello,
Is there a way I can figure out which my.cnf mysql is currently using? The reason is because it's using the correct socket file to connect, but I can't figure out exactly which (if any) my.cnf it's using or trying to use so I can manually set the correct path on my local machine.
...
Hi everybody
I'm pulling my hairs off since two days now because I'm trying to download an image from a website using HttpWebRequest.
When I call the method "GetResponse" of that class, I get the WebException "Unable to connect to the remote server.". The inner exception is "A socket operation encountered a dead network xxx.xxx.xxx.xxx:...
Hi Folks,
I have an application with client server architecture. The client
use Java Web Start with Java Swing / AWT and the sert uses HTTP server / Servlet with
Tomcat.
The communication is made from the serialization of objects, create a
ObjectOutput serializes a byte array and send to the server
respectively called the ObjectInp...
I am trying to get the IP of a socket connection in string form.
I am using a framework, which returns the SocketAddress of the received message. How can i transform it to InetSocketAddress or InetAddress?
...
I'm learning to use raw sockets, and im trying to prase out the tcp header data, but i can't seem to figure out what res1, ece, and cwr are. Through my networking book and google i know what the rest stand for, but can't seem to find anything on those three.
Below is the tcphdr struct in my includes area. Ive commented the parts a bit ...
I have a server that connects to multiple clients using TCP/IP connections, using C in Unix. Since it won't have more than 20 connections at a time, I figured I would use a thread per connection/socket. But the problem is writing to the sockets as I'll be sending user prompted msgs to clients. Once each socket is handled by a thread, how...
Hi,
I'm having the weirdest problem causing me headaches. Consider the following code:
// Create and bind socket
std::map<Connection, bool> clients;
unsigned short port=6222;
struct sockaddr_in local_address, from_address;
int result;
char buffer[10000];
SOCKET receive_socket;
local_address.sin_family = AF_INET;
local_address.s...
Sockets on Linux question
I have a worker thread that is blocked on an accept() call. It simply waits for an incoming network connection, handles it, and then returns to listening for the next connection.
When it is time for the program to exit, how do I signal this network worker thread (from the main thread) to return from the accep...
I have a loop which basically calls this every few seconds (after the timeout):
while(true){
if(finished)
return;
switch(select(FD_SETSIZE, &readfds, 0, 0, &tv)){
case SOCKET_ERROR : report bad stuff etc; return;
default : break;
}
// do stuff with the incoming connection
}
So basically for ...
Hi everyone,
I'm a socket programming newbie. Here's a snippet:
struct sockaddr_storage client_addr;
...
client_addr_size = sizeof(client_addr);
client_socket = accept( server_socket,
(struct sockaddr *)&client_addr, &client_addr_size );
...
result = inet_ntop( AF_INET,
&((struct sockaddr_in *)&client_addr)->sin_addr,
...
Hi!
I'm trying to create a left > php socket-server < right relation with php sockets.
Let's say that I have a server-daemon on the left side, like a vnc-server that connects to the socket-server.
On the right side I've got a client that want to connect to the left server-daemon, but it has to be done through the socket-server.
The s...
We're stuck with using buffers on the SocketAsyncEventArgs object.
With the old socket method we'd cast our state object, like this:
clientState cs = (clientState)asyncResult.AsyncState;
However, the 3.5 framework is different.
With have strings arriving from the client in chunks and we can't seem to work out how the buffers work s...
I noticed that many times while developing for an iPhone 3G, BSD socket functions will simply fail. I also noticed at the time, the 3G antenna wasn't even ON, nor was there WIFI Access to back up the network call (So it seems ridiculous that it doesn't turn on to support the network request).. This information was verified with an app ...