tag:blogger.com,1999:blog-9941980.comments2023-11-05T11:47:51.059+02:00Software DevelopmentVhttp://www.blogger.com/profile/07384298883237115882noreply@blogger.comBlogger191125tag:blogger.com,1999:blog-9941980.post-78178664595116523832018-09-26T12:43:33.931+03:002018-09-26T12:43:33.931+03:00with much thanks, shorter version:
{
...with much thanks, shorter version:<br /><br />{<br /> var endpoints = IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners();<br /> return endpoints.Any(endpoint => endpoint.Port == port);<br /> }Bhanuhttps://www.blogger.com/profile/14897171107247887273noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-39481896411167542972017-07-30T10:01:05.969+03:002017-07-30T10:01:05.969+03:00greatgreatMary Brownhttps://www.blogger.com/profile/05695070551792098532noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-28046775368853767412017-06-16T00:27:00.346+03:002017-06-16T00:27:00.346+03:00This is old but helped me today. If created much m...This is old but helped me today. If created much more shorter way:<br /> const int PrefixSize = 4;<br /> bool prefixSet = false;<br /> public int DataSize = 0; <br /> int RecLength = 0;<br /> byte[] Received = new byte[2048];<br /><br /> try {<br /> int dataRead = socket.EndReceive(ar);<br /> if (dataRead > 0) {<br /> Buffer.BlockCopy(buffer, 0, Received, RecLength , dataRead);<br /> RecLength += dataRead;<br /> if (RecLength >= PrefixSize) {<br /> if (!prefixSet) {<br /> prefixSet = true;<br /> DataSize = BitConverter.ToInt32(Received, 0);<br /> }<br /> if (RecLength >= DataSize) {<br /> RecLength = 0; prefixSet = false; <br /> byte[] data = new byte[DataSize];<br /> Buffer.BlockCopy(Received, 4, data, 0, DataSize);<br /> ReceiveNextMessage();<br /> Message m = new Message(this, data);<br /> }<br /> else {<br /> ReceiveNextMessage();<br /> }<br /> }<br /> else {<br /> ReceiveNextMessage();<br /> }<br /> }<br /><br /> }<br /> catch (Exception ex) {<br /> Console.WriteLine(ex.ToString());<br /> }Anonymoushttps://www.blogger.com/profile/15910670611801558188noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-30413684544390732482014-06-10T07:59:00.666+03:002014-06-10T07:59:00.666+03:00Fantastic DemoFantastic DemoPratham .NET Nerdhttps://www.blogger.com/profile/14649926433452662818noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-64479004605373092482012-05-22T20:06:35.519+03:002012-05-22T20:06:35.519+03:00in case we have to implement the same thing for a ...in case we have to implement the same thing for a non binary tree...would this code be able to work the same way? i guess the problem for a non binary tree would be there is no restriction on the no of children a node might have, so we can't just have only 2 pointers, we would neeed to have multiple pointers. any suggestions on how the above code can be modified to achieve this?acehttps://www.blogger.com/profile/00311615692658670841noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-55961876200938416822012-05-18T18:48:54.275+03:002012-05-18T18:48:54.275+03:00It depends on your protocol. Prefixing data with s...It depends on your protocol. Prefixing data with size will only tell you how much data you will receive, but does not tell anything about data. One way to handle this is add another byte after the prefix that will indicate data type. In this case your data packet will look like [SizePrefix][DataType][Data]. [SizePrefix] - 4 bytes and [DataType] - 1 byte.Vhttps://www.blogger.com/profile/07384298883237115882noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-51980150506467842602012-05-18T17:45:34.090+03:002012-05-18T17:45:34.090+03:00Hi, Thanks for your help. I also wonder how could ...Hi, Thanks for your help. I also wonder how could we handle data if client1 sends screen capture images data and file data to the server at the same time? Should we handle this situation by changing the prefix size for each type of data or should we use a byte delimiter? And what If client1 and client2 are sending screen capture image data to the server at the same time? Thank! =)Tom Nguyenhttps://www.blogger.com/profile/03285446703582774208noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-66139874983447046292012-05-15T22:44:08.498+03:002012-05-15T22:44:08.498+03:00It is a code constant like const int PrefixSize = ...It is a code constant like const int PrefixSize = 4; <br />If in the future prefix size will change, say it will become 5 bytes, then only PrefixSize value should be changed. No other code will require any adjustment to accommodate that change.Vhttps://www.blogger.com/profile/07384298883237115882noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-65223476561164550432012-05-15T22:24:05.006+03:002012-05-15T22:24:05.006+03:00Hi, I don't understand well. The "prefixs...Hi, I don't understand well. The "prefixsize" is first 4 bytes in the message that tell the server the size of the data to be receive..and is sent from the client right? if so..why is it a constant? Thanks. =)Tom Nguyenhttps://www.blogger.com/profile/03285446703582774208noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-6348078164847234232012-05-15T17:53:32.965+03:002012-05-15T17:53:32.965+03:00PrefixSize is just a constant. You can declare it ...PrefixSize is just a constant. You can declare it anywhere.Vhttps://www.blogger.com/profile/07384298883237115882noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-74943620610922750452012-05-15T15:39:25.768+03:002012-05-15T15:39:25.768+03:00hi, could you tell me where did you declare "...hi, could you tell me where did you declare "PrefixSize" ? is it in the ServerState class?Tom Nguyenhttps://www.blogger.com/profile/03285446703582774208noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-69970545300228634622012-04-22T10:11:32.817+03:002012-04-22T10:11:32.817+03:00This can be done with just one loop and one temp p...This can be done with just one loop and one temp pointer if you use the knowledge that you are using a left first or right first traversal. When you have to decide to go up, check if your temp is left of your parent or right of your parent. So assume u were doing left processing first, then if temp is left of parent, go to right of parent and continue to process left first. When you are right of your parent, start a while loop and continue to climb until you are not right of your parent or parent nul. In this loop keep updating parent and temp. Should be fast and doesn't change tree.Sandeephttps://www.blogger.com/profile/09647346914325643125noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-49318981763187179652011-10-13T10:20:16.149+03:002011-10-13T10:20:16.149+03:00You can surely start with this library http://www....You can surely start with this library http://www.mentalis.org/soft/projects/ssocket/.Vhttps://www.blogger.com/profile/07384298883237115882noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-2446990109858944632011-10-13T09:40:18.060+03:002011-10-13T09:40:18.060+03:00Thanks Vadym for the quick reply.
how can we buil...Thanks Vadym for the quick reply. <br />how can we build high performance secured socket server? any thoughts.My Jobhttps://www.blogger.com/profile/08717858659850719732noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-14623066710072418782011-10-13T08:55:31.118+03:002011-10-13T08:55:31.118+03:00There is no "open" implementation TLS ba...There is no "open" implementation TLS based on IOCP (SocketAsyncEventArgs) that I know of. You should create your own, using TLS RFC as a specVhttps://www.blogger.com/profile/07384298883237115882noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-13958375799917884282011-10-13T08:49:42.460+03:002011-10-13T08:49:42.460+03:00Hi,
Thanks for the post.
How can we implement SSL...Hi,<br />Thanks for the post.<br /><br />How can we implement SSL stream with IOCP (SocketAsyncEventArgs)<br />I could not find any samples over the internet. please provide your feedback on this.<br /><br />ThaksMy Jobhttps://www.blogger.com/profile/08717858659850719732noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-79731985843869708862011-06-16T08:18:19.558+03:002011-06-16T08:18:19.558+03:00I agree with you on the point that and I too detec...I agree with you on the point that and I too detected that I have TWO lsass.exe processes in the task manager. lsass.exe is a system process of the Microsoft Windows security mechanisms. Can you share some more links related to this this information.It will be helpful and informative. Thanks for the sharing information. <a href="http://www.arx.com/" rel="nofollow">digital signature software</a>laurenhttps://www.blogger.com/profile/06835407443449137284noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-11509203969025392352011-05-27T20:43:47.179+03:002011-05-27T20:43:47.179+03:00There is at least one rather cool usage of socket ...There is at least one rather cool usage of socket peeking, that I have seen.<br /><br />It was for a filtering process, that would allow multiple Apache web servers to coexist on the same system. The filter would peek at the incoming HTTP connection, without consuming the data. The purpose was to decide what Apache server should get it, and then hand the connection over to the Apache server, to fully read the data and handle the rest of the transaction.<br /><br />I don't want to spam your blog, but search for this: "msg_peek so_rcvlowat httpx".<br /><br />JoshKrellanhttps://www.blogger.com/profile/00854424622586829137noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-90292079207563698262011-05-26T13:57:16.086+03:002011-05-26T13:57:16.086+03:00thanks !thanks !Akankshahttps://www.blogger.com/profile/14742558074074793020noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-20403021187946082902011-03-15T15:53:05.950+02:002011-03-15T15:53:05.950+02:00I always recommend this show to all my friends. On...I always recommend this show to all my friends. Once they watch it they become big fan of this show. <a href="http://thebigbangtheory.otavo.tv/" rel="nofollow">Big Bang Theory</a> is my favorite show too. Mind blowing show.Unknownhttps://www.blogger.com/profile/13658187362903766191noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-70653749142455376002010-12-16T09:40:13.979+02:002010-12-16T09:40:13.979+02:00I think it's a shame our technology relies so ...I think it's a shame our technology relies so heavily on recursive data structures like XML for transfer--there have to be algorithms on both ends to pack and unpack them.<br /><a rel="nofollow">Ruby On Rails Developers</a>Jayhttps://www.blogger.com/profile/10080791983992656927noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-41038840159104730062010-11-17T13:43:51.742+02:002010-11-17T13:43:51.742+02:00This is my stack approach that doesn't involve...This is my stack approach that doesn't involve a Parent Node. Stacks are simple enough, so I hope this is able to help someone... The methods are rather self-explanatory from their names.<br /><br />public void iterativeinorder(Node localroot)<br /> {<br /> Node current = localroot;<br /> Stack stack = new Stack();<br /><br /> while (true)<br /> {<br /> if (current == null)<br /> break;<br /> else<br /> {<br /> if (current.leftchild != null &&<br /> current.leftchild.getvisitflag() != true)<br /> {<br /> stack.push(current);<br /> current = current.leftchild;<br /> }//end if<br /> else<br /> {<br /> if (current.getvisitflag() != true)<br /> {<br /> current.displaynode();<br /> current.setvisitflag();<br /> }//end if<br /> else<br /> {<br /> if (current.rightchild != null &&<br /> current.rightchild.getvisitflag() != true)<br /> {<br /> stack.push(current);<br /> current = current.rightchild;<br /> }//end if<br /> else<br /> {<br /> if (stack.isempty())<br /> break;<br /> current = stack.pop();<br /> }//end else concerning right child<br /> }//end else (current.getvisitflag() == true)<br /> }//end else concerning left child<br /> }//end else (current != null)<br /> }//end while<br /><br /> resetflags(localroot);<br /> }//end iterativeinorder<br /><br /><br />Sorry for the rather awful formatting, lol. It looks a bit better in an IDE.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9941980.post-77025516368590582092010-11-12T22:53:16.553+02:002010-11-12T22:53:16.553+02:00There is the Schorr-Waite traversal algorithm[1], ...There is the Schorr-Waite traversal algorithm[1], commonly used for garbage collection. It tracks state by rotating pointers. The algorithm works for arbitrary graphs if you add two bits of extra state per node. If there are no cycles, there is a variant due to Lindstrom[2] that requires no extra space.<br /><br />[1] H. Schorr and W. Waite. An efficient machine independent procedure for garbage collection in various list structures. Communications of the ACM, 10(8):501–506, August 1967.<br /><br />[2] G. Lindstrom. Scanning list structures without stacks or tag bits. Information Processing Letters, 2(2):47–51, June 1973.stephenhttps://www.blogger.com/profile/03722370267888902995noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-28792950503309724822010-11-12T19:04:20.860+02:002010-11-12T19:04:20.860+02:00Is there any solution possible without the parent ...Is there any solution possible without the parent node and not using a stack?Kannanhttps://www.blogger.com/profile/01786091272775592667noreply@blogger.comtag:blogger.com,1999:blog-9941980.post-22875556788842085832010-10-24T11:51:37.288+03:002010-10-24T11:51:37.288+03:00Nice explanation. Just what I was looking for.
M...Nice explanation. Just what I was looking for. <br /><br />Many thanks,irfanhttps://www.blogger.com/profile/11601582823200426073noreply@blogger.com