My programme listens for just one connection once... the programme just gets stuck at clientSocket = serverSocket.accept() if no client connects. I mean I can't even interrupt it by closing my window. I can't click any of my buttons in the frame etc.
I've used this code the same way in my other programmes but it's worked fine (I can cli...
Hello,
There is a function assign in Boost.Asio sockets, however I'm looking for something like
release/unassign that would transfer the ownership on socket back to user.
or
some type of assign that would not transfer ownership to socket class, so it would not close it when destroyed.
I'm aware of this solution but it involves d...
I wanted to know how to flush the socket streams while doing socket programming in C. I tried all the options- setting TCP_NODELAY using the following code-
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int));
Note: all the flag and sockfd are declared correctly.
I used this function both before send() an...
I need to set the DSCP field of packets sent from a specific (tcp) socket in windows XP.
It seems that the GQOS API should serve this purpose (see http://blogs.msdn.com/wndp/archive/2006/07/05/657196.aspx) but I really, really, can't find any working example or figure how to use it on my own.
I would be very grateful if anyone of you h...
My question is that when a socket at the receiver-side sends an ack? At the time the application read the socket data or when the underlying layers get the data and put it in the buffer?
I want this because I want both side applications know whether the other side took the packet or not.
...
I'm having a problem with a multiplayer game. Right now, I'm just trying to get the server to send the current level to the client. The server is definitely sending the data, but it never gets to the client application.
Client code:
public void run() {
while(true)
{
try {
sel.select();
Set r...
Hello
Can't find any gem or class which can help to made a non-blocking/multithread server.
Does anybody know where to find any ?
...
I'm trying to read a number of Bytes from a socket in Haskell. Bascially I want to do something equivalent to this:
client_socket.recv(255) #(Python)
What's the best way of doing it?
...
Hi all;
Below is the code fragment I have issue with socket programing. Here after select call, If I do not put a sleep on line 9, on Windows XP, 1 byte is received on line 11 (instead 4 byte is sent from server as integer), when I check xmlSize, it is set to 0. Because iResult is 1, execution continues and on line 15 second receive is c...
I have a silverlight app hosted on "dev.system-engine.com" which creates an tcp connection connecting to "dev.system-engine.com"
the silverlight app and the policy file are on the "dev.system-engine.com" webserver.
"system-engine.com" and "dev.system-engine.com" are separate servers.
I cannot seem to get it to work. I have been strugg...
Hi all,
I'm doing a bit of coursework for university and I'm completely baffled. Basically I've made a basic web server (which uses sockets) in C. I've now got to make it so that any .php file, is run through the php compiler and output.
The problem I'm having is that I've tried using system() and execlp() (the latter was recommended b...
Here is My ActionScript Code:
var S:Socket=new Socket("127.0.0.1",2222);
Here is My CrossDomain.XML File (Located at http://127.0.0.1/crossdomain.xml)
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*...
I was just going through the Networking Guide by Beej and am curious about this part of the code (specifically marked with "From here" and "To here"):
// main loop
for(;;) {
read_fds = master; // copy it
if (select(fdmax+1, &read_fds, NULL, NULL, NULL) == -1) {
perror("select");
exit(4);
...
I'm using Perl 5.8.8 and trying to determine if Perl automatically and consistently restarts the readline function ( better known as <> ) if it's interrupted by a signal.
I want to safely read newline '\n' terminated strings from a TCP socket using readline.
In the section Deferred Signals (Safe Signals) it says:
Restartable syst...
Let me refrase it. i am writing a new http-server using sockets in java-language(not javascript) and i want to tell client to set cookie. I would like to do that in javascript(setin reading the cookie). If that is not possible, Are there other solutions?
Thank you all.
...
How many is the maximum number of sockets in java under windows?
How can I change it?
...
I have the following code:
if ( ( m_mainSocket = ::socket( PF_INET, SOCK_STREAM, IPPROTO_TCP ) ) < 0 )
{
throw Exception( __FILE__, __LINE__ ) << "Unable to create socket";
}
int on( 0 );
if ( setsockopt( m_mainSocket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof( on ) ) )
{
throw Exception( __FILE__, __LINE__ ) << "Can't make server...
I have this simple code running on my windows server just fine, but when I run it in mono after a couple days I start getting only OutOfMemory exceptions.
public static byte [] TryReceive (Socket sock, out int nLength)
{
nLength = 0;
try {
int size = sizeof(int);
byte [] data;
int recv = 0;
int offset = 0;
d...
Essentially I want a basic Java Server which multiple people can be connected to and when one of the connected clients (Already coded in Obj-c) sends data to it, it sends it back to everyone who is connected.
I'm a real Java Newbie and I'm not going to need Java in the forseeable future for anything but this so I want it out the way as ...
In java when you close a socket it doesn't do anything anymore but it actually closes the tcp connection after a timeout time.
I need thousands of sockets and I want them to be closed exactly after closed them not after wasting my time and my resources!
What can I do?
Thank you.
...