TCP/IP how to get into "established" state - TCP-IP

This is a discussion on TCP/IP how to get into "established" state - TCP-IP ; Hello everyone, I have a problem with my TCP/IP Code. I can send TCP packets in both directions as long as i create a new socket when ever i need to send something. but if i try to use one ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: TCP/IP how to get into "established" state

  1. TCP/IP how to get into "established" state

    Hello everyone,

    I have a problem with my TCP/IP Code. I can send TCP packets in both
    directions as long as i create a new socket when ever i need to send
    something. but if i try to use one socket permanent to send tcp packets in
    both directions i never get the state: established.
    On one side (name it client) it is fin_wait2 (the side where i forced the
    connection)
    On the other side (name it server) it is wait_close (the side where i accept
    to connections)
    I still can send tcp data (through this single socket) from client to server
    but not the other way round, and the socket is closed after some time.

    What do i wrong? is there a special API call i missed? (It is all in Win32
    API). Both sides use the same port. I listen on both sides for incoming
    connections on the same port, is this a problem?

    hope someone can help???

    greetings Wolf




  2. Re: TCP/IP how to get into "established" state

    In article <4661de9e$0$10197$9b4e6d93@newsspool4.arcor-online.net>,
    "Wolfgang Tischer" wrote:

    > Hello everyone,
    >
    > I have a problem with my TCP/IP Code. I can send TCP packets in both
    > directions as long as i create a new socket when ever i need to send
    > something. but if i try to use one socket permanent to send tcp packets in
    > both directions i never get the state: established.
    > On one side (name it client) it is fin_wait2 (the side where i forced the
    > connection)
    > On the other side (name it server) it is wait_close (the side where i accept
    > to connections)
    > I still can send tcp data (through this single socket) from client to server
    > but not the other way round, and the socket is closed after some time.
    >
    > What do i wrong? is there a special API call i missed? (It is all in Win32
    > API). Both sides use the same port. I listen on both sides for incoming
    > connections on the same port, is this a problem?


    If the client is in FIN-WAIT state, this means it has sent a FIN, which
    indicates that it's not going to send anything more on that connection;
    you get into this state by calling shutdown(sd, SHUT_WR). Why are you
    trying to send after you've said you're not going to send any more?

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

+ Reply to Thread