IrcDotNet icon indicating copy to clipboard operation
IrcDotNet copied to clipboard

Network Information Received

Open hypodyne opened this issue 6 years ago • 13 comments

So you connect to a network(Freenode), and it sends back the network information. 251, 252, 253, 254, 255, 265, 266, 250

IrcDotNet throws the NetworkInformationReceived event with the details in e.Comment.

e.Comment sometimes contains a properly formatted string

"There are 109 users and 84695 invisible on 32 servers"

and sometimes e.comment contains a number as a string.

"5"

The event is thrown 5 times out of the 8 responses. The last 3 never throw the event.

The way the Network Information is structured, I can't use sender to get the information, because there is no way to tell which piece of information threw the event.

hypodyne avatar Jan 27 '19 21:01 hypodyne

You want to tell me that it splits on 84695 between 8469 and 5 ?

wix-andriusb avatar Feb 03 '19 07:02 wix-andriusb

I have a wireshark capture, and it seems if the response from the server is incorrect, then IrcDotNet also gets it wrong. Let me post a screenshot.

hypodyne avatar Feb 03 '19 08:02 hypodyne

wireshark

Since freenode is sending packets which I presume are longer than the 1024 limit, it gets split in the wrong place. (in wireshark) and IrcDotNet can't handle that either. What happens is 265, 266, 250 don't throw an event. thats item 1.

hypodyne avatar Feb 03 '19 08:02 hypodyne

wireshark2

Another issue is that IrcDotNet throws the NetworkInformationReceived event with just 35 as the comment. What it should be is "35 :IRC Operators online". Without that extra info there is no telling which of the 7 different network information properties it comes from.

hypodyne avatar Feb 03 '19 09:02 hypodyne

So the issues here are:

  • If the server sends a response with > 1024 bytes, it gets split in the wrong place.
  • Event 252 (RPL_LUSEROP) has an integer field and some additional info

Is that correct?

The first one seems to be offspec, since the returned message can be only a certain size ... But we live nowadays with so much ubiquitous memory, I think we could use System.IO.Pipelines to actually address this. That library would resize the used buffers automatically for us, also the most simple example for it literally just read lines (ending with \n)

Here is a nice list of events https://www.alien.net.au/irc/irc2numerics.html

txdv avatar Feb 04 '19 05:02 txdv

Yes, that is what I think is happening.

A few network information events return an int (and that is all they return) in e.Comment.

Really all events should be returning enough information so that you can post the response.

hypodyne avatar Feb 04 '19 05:02 hypodyne

Yes here is one too http://www.networksorcery.com/enp/protocol/irc.htm

Notice 252

hypodyne avatar Feb 04 '19 05:02 hypodyne

16

hypodyne avatar Feb 04 '19 05:02 hypodyne

34

hypodyne avatar Feb 04 '19 05:02 hypodyne

73

hypodyne avatar Feb 04 '19 05:02 hypodyne

16, 34, 73 What do they mean. Without context they are useless.

hypodyne avatar Feb 04 '19 05:02 hypodyne

This is not IRC, try to add all comments in one response :D Also do you know what all of the meanings of the integer parameter in notice 252 are? Maybe there is a source which describes them?

I think you are right that events in the library should contain everything that is needed, its just that in open source usually something happens when someone needs it or makes an issue out of what he dislikes about a certain library.

txdv avatar Feb 04 '19 05:02 txdv

Just letting you guys know. It's not important at all.

hypodyne avatar Feb 04 '19 05:02 hypodyne