problems with linux using sockets

problems with linux using sockets

Post by Onno Veldstra - Software Designe » Tue, 01 Oct 1996 04:00:00



I have a problem with linux. I run a haven (chatbox) on my ISP's linux
box, and it keeps crashing. It is a program which allows a number of
people to connect to the server with telnet (chat.uwd.net, port 9999).
weird thing is, that when some people leave, without giving the exit
command (.q), but by terminating the telnet program or the connection,
that the haven crashes. This is not the case with other havens running
on a Linux machine, or with the same haven code running on a
sparcstation/server with solaris or SunOS 4.1.x.
Can this be a bug in the kernel, or in one of the libraries?? I am now
clueless, I ran over the source code many times, compared it with
others, and there seems nothing wrong with that. Source code is
available for those interested (100k tar.Z file, request by email
please).
The kernel my ISP uses is Linux 2.0.19

Any help is welcome.

Onno Veldstra


------------------------------------------------------------------------

"choose a job you love, and you never work a day in your life"
    - Confucius

 
 
 

problems with linux using sockets

Post by Reality is a point of vi » Wed, 02 Oct 1996 04:00:00



 | I have a problem with linux. I run a haven (chatbox) on my ISP's linux
 | box, and it keeps crashing. It is a program which allows a number of
 | people to connect to the server with telnet (chat.uwd.net, port 9999).
 | weird thing is, that when some people leave, without giving the exit
 | command (.q), but by terminating the telnet program or the connection,
 | that the haven crashes.
 +----

My guess would be a problem with SIGPIPE handling, especially if
sigaction() wasn't used.

--
Gary Johnson                                                   "Rosebud . . ."

                             CAMPAIGN '96: Juck 'em if they can't fake a toke.

 
 
 

problems with linux using sockets

Post by Onno Veldstr » Wed, 02 Oct 1996 04:00:00




> | I have a problem with linux. I run a haven (chatbox) on my ISP's linux
> | box, and it keeps crashing. It is a program which allows a number of
> | people to connect to the server with telnet (chat.uwd.net, port 9999).
> | weird thing is, that when some people leave, without giving the exit
> | command (.q), but by terminating the telnet program or the connection,
> | that the haven crashes.
> +----

>My guess would be a problem with SIGPIPE handling, especially if
>sigaction() wasn't used.

>--
>Gary Johnson                                                   "Rosebud . . ."

>                             CAMPAIGN '96: Juck 'em if they can't fake a toke.

sigaction() is indeed not used, but the weird thing is still: the
crashing is caused most of the time by people who use Windoze95 (not
surprising 'ey). And as I said in the previous posting, under SunOS and
solaris this isn't a problem.
I will hack in the sigaction and see what it does.

Onno Veldstra

 
 
 

1. problem with socket code (well, it uses socket libraries anyway)

I'm having problems compiling my code, I sort of understand the error,
but I don't know how to correct the problem, here's the error:
detect.c: In Function 'main':
detect.c:21: warning: comparison of distinct pointer types lacks a
cast

now heres the source code. What I'm atleast trying to do is get the
address of the user and well, give different output for certain users.
I think I got it, I think I just need to reorganize/fix some stuff.
Help would be appreciated.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>  
int main()

{
        int addr;

        struct sockaddr_in their_addr;
        struct hostent *name;

        their_addr.sin_family = AF_INET;
        their_addr.sin_port = htons (80);
        addr = inet_aton (getenv("REMOTE_ADDR"),&(their_addr.sin_addr));
        memset (&(their_addr.sin_zero),'\0',8);
if ((name=gethostbyaddr (&addr,sizeof(addr),AF_INET)) ==
"location.com")
        {

                printf ("Hello");
          exit(0);
        }

        else {

                printf ("Hey");
                exit (0);
        }

2. 1280x1024, ATI mch64, XF3.1.1

3. Strange problem in using Linux TCP socket

4. BOOOOOOOOOT ?!

5. Reclaiming used socket fd or how to close sockets properly

6. Ip-filter problem...

7. Socket : which process is using my socket?

8. Garbage in floating point numbers?

9. TCP Socket Using connect in Non Blocking - Results in errors using recv()

10. Problem using sockets in c++

11. Problem using read on tcp socket

12. Client-Server , problem using send(socket,...) command .

13. Problem with sockets using perl, Solaris 2.5.1