• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Winsock issue

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Winsock issue

    I'm trying to help with diagnosing a network issue. The problem that occurs is never receiving any data on a socket. It's created as follows:-

    socket(AF_INET,SOCK_STREAM,0)

    This sertainly does not return invaid_socket so the assumption is there is a valid socket.

    The problem being experienced is that where the network cable is unplugged at the client end no data is ever received. Where the network cable is unplugged at the switch then data is received when the cable is reconnected.

    Thus my suspision is that there is some sort of option or something on the socket that should be set. I know approximately nothing about sockets, but am rapidly searching API's etc to try and find out. Any suggestions.

    Cheers.

    #2
    Originally posted by ASB View Post
    The problem being experienced is that where the network cable is unplugged at the client end no data is ever received. Where the network cable is unplugged at the switch then data is received when the cable is reconnected.
    I don't quite follow this bit - can you clarify?
    Where are we going? And what’s with this hand basket?

    Comment


      #3
      Originally posted by voodooflux View Post
      I don't quite follow this bit - can you clarify?
      Ok: when the socket is created this works:-

      - Network cable is plugged into the client but not the server.

      In the case when the cable is subsequently plugged into the server the client software works normally.

      But this doesn't:-

      - Network cable is not plugged into the client but is plugged into the server.

      In this case when the cable is plugged into the client then it does not see the incoming data.

      What I **don't know** is whether:-

      1) It is because there is some issue in the socket library and some parameters are not being set properly
      2) It is something in the protocol between my client and the server

      I've only got a small amount of trace and do have access to the code, but most of it means bugger all to me!

      I am trying to track down a winsock shim so I can hopefully see the differences in the parameters to the API's in the good and the bad case.

      Comment


        #4
        Originally posted by ASB View Post
        The problem being experienced is that where the network cable is unplugged at the client end no data is ever received. Where the network cable is unplugged at the switch then data is received when the cable is reconnected.
        Are you unplugging the right cable at the switch? When you unplug at the client end, Windows says the network connection has been lost because ethernet has stopped working. But if you unplugged the cable from the server (or whatever you're communicating with) at the switch, then the client still has its ethernet connection, and would behave differently. That's my guess, and I don't think you can influence any of this with socket options. But you should be able to detect a failure like this and retry.
        Will work inside IR35. Or for food.

        Comment


          #5
          Originally posted by VectraMan View Post
          Are you unplugging the right cable at the switch? When you unplug at the client end, Windows says the network connection has been lost because ethernet has stopped working. But if you unplugged the cable from the server (or whatever you're communicating with) at the switch, then the client still has its ethernet connection, and would behave differently. That's my guess, and I don't think you can influence any of this with socket options. But you should be able to detect a failure like this and retry.
          Yes, it's the right cable... I think your guess is right, it's a question of how we deal with it since all I can tell from the traces I have is that the select is timing out.

          Comment


            #6
            Originally posted by ASB View Post
            Yes, it's the right cable... I think your guess is right, it's a question of how we deal with it since all I can tell from the traces I have is that the select is timing out.
            You will only get a socket error when a cable is not plugged into the host that is expecting the socket error. Otherwise, why would it think there is no socket? Maybe a wrapper of some sort is needed in order to determine if the remote machine is (not) communicating with the host and abends if no communication is present?
            If your company is the best place to work in, for a mere £500 p/d, you can advertise here.

            Comment

            Working...
            X