hello everyone. I tried searching for something related to this, but I figured it was time to ask my own question. I am experiencing these problems using Ubuntu 7.04
I am starting up a TCP listener/server and once connected, will act as a communication/control link with a program on another computer. In the final iteration I want it to run it like a daemon, disconnected from a controlling process so I am going to do:
This is simplified as i am using functions and setting socket options, particularily the SO_REUSEADDR option.
If I do NOT run the fork and just run the socket->bind->listen->accept I get the same problems.
The problem is:
The client connecting, whether it is my client, or even netcat will connect properly, but then the server immediately sends a disconnect. The server does not get out of accept() during this, and even stranger it is random, and sometimes it works (60%), and sometimes it doesn't (40%).
I could tell it connected and disconnected right away by using wireshark, I got a SYN -> SYN/ACK -> ACK and then right away FIN/ACK -> FIN/ACK -> FIN. Using netstat -ta also shows the ports getting gummed up in TIME_WAIT as though it did connect and disconnect.
What i think could be the problem
Two things I have done:
one is to not set the SO_REUSEADDR parameter, and it then works as expected, although I have not done as much testing because it requires you to wait for a minute after each test for the TIME_WAIT to clean up.
two, before I set up the socket, I read some parameters from a config file, by opening and closing it. If I comment this out and hard-code the port to listen on, etc, the occurance of it is MUCH less, although can still happen.
I am at my wits end with this. Is there anything I can do to figure this out or help debug it. I am pretty sure it has to do with file handles getting gummed up or something like that. But i have no Idea!
Sorry. You are right. After a successful accept() I go into a while loop where I read and do various things. I just wrote slimmed down code to give an over-view of what I was doing. I am doing all the error checking and never return a -1. The program, when a proper connection does happen, works perfectly, however, the chances of getting an accept is about 50/50, BUT the client DOES briefly connect.
My suggestion: check for ECONREFUSED error in client.
I think the old connections can affect newly relaunched server
and maybe they overflow listen specified queue length.
I have very limited knowledge on LDAP configuration and have been trying fix one issue, but unsuccessful.
The server, I am working on, is Solaris-10 zone. sudoers is configured on LDAP (its not on local server). I have access to login directly on server with root, but somehow sudo is not working... (9 Replies)
I have problem with oracle solaris 10 running on oracle sparc T4-2 server.
Os information: 5.10 Generic_150400-03 sun4v sparc sun4v
Output from tcpstat.d script
TCP bytes: out outRetrans in inDup inUnorder
6833763 7300 98884 0... (2 Replies)
Hi all,
i have some doubts in a situation that i fail to get an answer in Google.
I have a solaris 10 nfs server and 5 centos 6.0 nfs clients.
The problem/situation is that in the clients the free memory is "disappearing" along the time (passing to used)..and it gets free if i umount the... (5 Replies)
Hello!
I searched forum for similar topic, with no luck, if you know one, delete this topic, and send me private message with link please.
Little background:
I have a lot of clients and one serwer. Client can make multiple connections on different ports and ips, but only one can be acctive... (2 Replies)
I made a program and now I need to make it concurrent.
Can someone pls help me do this ?
The code is this:
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>... (4 Replies)
While in SCO Openserver 5.0.7, Sybase listened to /dev/inet/tcp, the same is not working in SCO Openserver 6. The Network card is however active and pinging fine. What can be the reason? What is the way out?
An early response will be appreciated.
Thank you
Regards
TCG (2 Replies)
I just installed the latest version of unbuntu server and want to connect from windows using a ssh client. This is my first linux server, so bare with me =)
For my server...
cat /etc/hostsgives me
127.0.0.1 localhost
127.0.1.1 ubuntuHomeI tried using ssh secure shell and putty in vista.... (11 Replies)
Hi,
my problem is that I am not able to grand the nfs directory on a Fedora 7 server to a standard solaris client.
I always got the messages no permission.
Important: No change on the client (Solaris) is possible! So I am not able to change the NFS Version on the client side to force the... (3 Replies)
Hello all,
Can someone instruct me on how to change the listening port for ftp ( or any tcp service) from 21 to another port number? Thanks in advance..
-AJ (3 Replies)
Hi,
Im programming a perl script which will act as a daemon listening on a tcp port (2323) and will take (<stdin>) from the client (im going to use telnet) and run the arguments from (<stdin>) against an program already on the server, which is used to list books in the library at uni.
So far... (1 Reply)