| |
| |
| |
|
Comments:
<0> hi. how can I cast object to byte[]? (byte[])obj gives me error <0> I receieve buffers with Socket.BeginReceieve. what would be the best way of splitting it into messages separated by "\r\n"? <1> you'll have to concat the incomnig data <1> until you have an \r\n in it <1> then process it <1> hey blade.
<1> day off? <0> ki9a how? I want to do something more generic, so that user of my cl*** can read until any byte <1> cripple_: you have to understand that you aren't guaranteed to receive full data sent in 1 go <0> yes I realize that <1> so you have to keep appending data to a buffer until you find your terminator <1> could be any character <1> or a 4 byte length before the package <1> or anything <1> depending on the protocols used. <0> I can have many messages in a single buffer, or not a single complete one <1> yes <0> so what, I would have two buffers? <0> I'm not sure how to handle this without doing a mess <1> just the one buffer <1> keep filling it in your receive callback <1> then after each fill <1> check if there's whatever you use to terminate a strea <1> string <1> if so, remove that from the buffer and process it <1> again and again till there's nothing left to process <0> sorry was away for a second <0> but what if the buffer can't hold entire message? <0> say that buffer is 128 bytes and message 200 <0> am I allowed to start another BeginSend with System.Socket before the first one was completed? or should I keep my own queue
<1> well you use a dynamic buffer of course <1> don't call beginsend twice <1> without an Endsend <1> I did that once and it really didn't go wel <0> data got mixed up? <1> yes <2> mmm mixed data with a side of crc errors please! <0> so I should keep two queues, send and recv. and I can send and recv at the same time with same socket? <0> I haven't done async networking before <1> you could yes. <0> how would I change text of status strip? statusStrip1.Text = "Connected"; doesn't do anything <0> Error'System.Windows.Forms.StatusStrip' does not contain a definition for 'panel'C:\Documents and Settings\Dejan Kostadinovic\My Documents\Visual Studio 2005\Projects\irc client\irc client\Kosta.csirc client <3> what is the difference between declaring a string as "String" versus "string" ? <1> S vs s <1> though the type is the same. <1> String is a type <1> while string is a keyword <1> that ends up as a System.String type <3> ahh ok <3> so its like a symlink for the String type ;) <3> I was looking at other peoples code and notices some people use String to declare and some use string to declare <1> well if you don't add: using System; <1> String won't work <1> but string will work <3> ahh I see <3> thanks ki9a
Return to
#csharp or Go to some related
logs:
reboot with f8 into safe mode
DEXAMPHITAMINE #stocks #linuxhelp steve beats JPOPSuki porn #politics #nhl tcl notice to nonop #beginner
|
|