ETIMEDOUT - why?

Why do I get this error?
Am I possibly creating my TCPSockets incorrectly?
When I have more than 10 connections going out I tend to get this error.
Now, I can rescue the error, but that’s not what I want.
How do I code this correctly? (It’s just a simple implementation)

How can I end a TCP conversation/connection with fin/ack and not RST?

On Mon, Jan 7, 2013 at 12:39 PM, Sarek M. [email protected]
wrote:

Why do I get this error?
Am I possibly creating my TCPSockets incorrectly?
When I have more than 10 connections going out I tend to get this error.
Now, I can rescue the error, but that’s not what I want.
How do I code this correctly? (It’s just a simple implementation)

It’s almost impossible to answer your questions with as little context
as you provided. Please provide more details. What is your
application doing? Where do you get timeouts? Did you make sure
network connectivity between the two computers involved is OK? Are
you sure there are no artificial limitations to connections that can
be opened? What kind of software are you connecting to? …

Kind regards

robert

Oh, should I mention this is TCP/HTTP?
Any possibilities are fine. In fact, a decent book concerning RST, Error
timeouts (all errors?), TCP (I already know ‘too much’ i.e. finding it
difficult to actually ‘learn’ more), and fin/ack. In fact, if someone
can tell me if it’s possible to close connections with fin/ack rather
than RST. That helps too.

It’s either on the client-side or the server-side, I think it’s on the
server-side, but I just wanted to check it’s not on the client-side.
I’m really bad at programming sockets… in general, actually.
(sometimes up to 20 connections are created) This is all it is, just
re-used and repeated in same cases. (Without the values of the
variables):

socket = TCPSocket.new server, 80
socket.print(request)
socket.flush # is that even needed?..
socket.close

If it is the server ignoring when I have 10+ connections, I wonder how I
can deal with that… I thought tcp was supposed to end with a fin/ack
handshake, not RSTs…

Thank you, really if I could just get some help I would appreciate it.
Anything that might help me?

*artifical limitations? No clue.
*where do I get time-outs? 10+ connections, I think after SYN is sent.
*Network connectivity? Fairly certain that’s fine. I can’t test it
beyond what I have.

On Mon, Jan 7, 2013 at 1:57 PM, Sarek M. [email protected]
wrote:

I’m working on debugging it, but shrugs sometimes ‘block in connect’,
sometimes 504 http error, or 408 http error. Maybe when I learn
something I’ll figure it out.

Wireshark is your friend - if you can / are allowed to use it.

Cheers

robert

I’m working on debugging it, but shrugs sometimes ‘block in connect’,
sometimes 504 http error, or 408 http error. Maybe when I learn
something I’ll figure it out.

On Mon, Jan 7, 2013 at 1:06 PM, Sarek M. [email protected]
wrote:

Any possibilities are fine. In fact, a decent book concerning RST, Error
timeouts (all errors?), TCP (I already know ‘too much’ i.e. finding it
difficult to actually ‘learn’ more), and fin/ack. In fact, if someone
can tell me if it’s possible to close connections with fin/ack rather
than RST. That helps too.

http://www.kohala.com/start/unpv22e/unpv22e.html

It’s either on the client-side or the server-side, I think it’s on the
server-side, but I just wanted to check it’s not on the client-side.
I’m really bad at programming sockets… in general, actually.

I don’t understand this: first you say you know too much and now you
say you’re bad at socket programming. Maybe you know the wrong
things?

(sometimes up to 20 connections are created) This is all it is, just
re-used and repeated in same cases. (Without the values of the
variables):

socket = TCPSocket.new server, 80
socket.print(request)
socket.flush # is that even needed?..
socket.close

Better use the block form because otherwise proper cleanup is not
guaranteed.

TCPSocket.new server, 80 do |socket|
socket.print(request)
end

I think #flush is usually not needed:

TCPSocket.open(‘www.google.com’, 80) {|s| p s, s.sync}
#<TCPSocket:fd 5>
true
=> [#TCPSocket:(closed), true]

If it is the server ignoring when I have 10+ connections, I wonder how I
can deal with that… I thought tcp was supposed to end with a fin/ack
handshake, not RSTs…

Thank you, really if I could just get some help I would appreciate it.
Anything that might help me?

Post your code - client and server.

Cheers

robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs