mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2010
Posts: 4
S
Syber Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
I am working on a script that traps URLs and posts them to Instapaper.com using his API.

In 6.35 I believe everything was functioning (although the script was admittedly still pretty new).

After updating to 7.1 I seem to get a ton of timeouts, but I'm not sure if they're in fact timeouts, because it's difficult for me to troubleshoot. The issue I discovered during troubleshooting is that I cannot open a named socket. I repeatedly get "socket in use".

However when I receive that error, and type /socklist, I am told that no sockets are open. Furthermore, //echo -a $sock(n).status tells me there are insufficient parameters (suggesting that socket doesn't exist).

Because of this erratic behavior I can't really tell if the socket is hung open, or what is really going on.

Any tips/advice would be awesome. For what it's worth I am connecting to the Instapaper URL via SSL on port 443.

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
If you are using specific port numbers, it may be that after the port is used and closed it will be in a TIME_WAIT state. The new version of mIRC is more precise in detecting ports that are in that state and will not use them until Windows makes them available again.

If you download a program like TcpView or CurrPorts, you will be able to see that state of each port on your system as well as their states.

If the above does not look like it is the cause, can you post a very short script that reproduces the issue for you?

Joined: Aug 2010
Posts: 4
S
Syber Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
Thank you for the response Khaled. After investigating with TCPView, it appears what's occurring is the server isn't severing the connection as early as I expect. As you said it's probably just the more accurate way the new mIRC handles the port state.

I will adjust my script to be more robust in terms of actively closing sockets that i have determined to be "complete".

Thanks again!

Joined: Aug 2010
Posts: 4
S
Syber Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
Upon further investigation it appears that using the non-SSL version of instapaper.com causes no issues at all. The script works as it did in 6.35.

However if I switch the URL/Port to use the SSL version of the API, I experience the hangs and/or forcibly closed connections.

Issuing the following command (after clearing mIRC's SSL cert cache):

/sockopen -e testSock www.instapaper.com 443

gives me a prompt to accept the certificate (which I do, permanently).

From here you can close the socket /sockclose testSock.

Repeating the process will get me prompted another two times (for a total of 3 certificates).

I assume this is a result of a server-farm of sorts on the website end of things. However I don't recall this behavior in 6.35. Following me accepting all three certs. I still have issues where the website only responds in a timely manner once every few times, whereas the non SSL URL responds immediately.

I'm honestly not quite sure whether this is a result of the update to mIRC or a bad coincidence with that website, but I'm not sure how else to trouble shoot.

I feel that calling this a "bug" is probably not totally correct as I can't replicate it on command. I will post code as soon as I can make it happen every time; but in the mean time suffice to say even when it works via SSL, the time to achieve it is substantially slower than both non-SSL, and my using SSL on 6.35.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
I haven't tested any of this, but perhaps a quick suggestion / clarification might help:

Have you tried running this in 6.35 at the same time of day as you tested 7.1? If so (tested within the same minute or so), you can rule out "coincidences" with the website speed-- there shouldn't be a significant difference in server responsiveness in a minute's time-- not after multiple runs, anyway. That, IMHO, would make it an mIRC issue, albeit a hard one to reproduce.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
Quote:
/sockopen -e testSock www.instapaper.com 443


i think /sockopen it's without the http://


WorldDMT
Joined: Aug 2010
Posts: 4
S
Syber Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
@chacha: you are correct. I wasn't using the http:// in my script, that was just a typo in my example.

Good catch. I'm currently experimenting with 6.35 side by side so I can determine if I can reproduce the behavior.


Link Copied to Clipboard