Linux: Sample: Client - Server (Connection Error)

This is a discussion on Linux: Sample: Client - Server (Connection Error) within the Networking/Device Communication forums, part of the General Programming Boards category; Hi, I was also working to create a Client Server Application. But I'm getting connection error after sometimes. (No regularity) ...

  1. #1
    Registered User zahid's Avatar
    Join Date
    Aug 2001
    Posts
    532

    Linux: Sample: Client - Server (Connection Error)

    Hi,
    I was also working to create a Client Server Application. But I'm getting connection error after sometimes. (No regularity)

    Here is the sample code from TCP/IP V-3 by R.Stevens
    [ Never code before desk work ]
    -------------------------------------:-->
    A man who fears Nothing is the man who Loves Nothing
    If you Love Nothing, what joy is there in your life.
    =------------------------------------------------------= - I may be wrong.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>But I'm getting connection error after sometimes
    Can you be more specific? Post your troublesome code here rather than linking to code from a book.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User zahid's Avatar
    Join Date
    Aug 2001
    Posts
    532
    Okay .. at least a response from one. Thank you for that.

    That's modified code which I'm working with.

    I was testing what happen when client is trying to send data and server is not running.

    In that situation, when I start the server, some times it works(receive data), some times not.

    Note: Original code does not contain
    #define MSG_EOF 0x100 but used. Is there any problem with that?
    Last edited by zahid; 09-07-2003 at 05:43 AM.
    [ Never code before desk work ]
    -------------------------------------:-->
    A man who fears Nothing is the man who Loves Nothing
    If you Love Nothing, what joy is there in your life.
    =------------------------------------------------------= - I may be wrong.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>#define MSG_EOF 0x100 but used. Is there any problem with that?
    It depends what you're doing with it. Where are you using it in the code?

    Anyway, if you're putting it in the data as a trailing byte to denote EOF, it won't work as it is > 255, and therefore won't fit in one byte.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  4. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 12:10 AM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21