Click here to Skip to main content
15,896,285 members
Articles / Programming Languages / C#

Network Stuff (easy socket v3)

Rate me:
Please Sign up or sign in to vote.
4.87/5 (52 votes)
2 Jun 2005 217.2K   6.1K   137  
A class with event handlers for TCP, UDP or ICMP sockets; includes ping, traceroute, whois, ARP, and IPHelper functions and raw packets forging/ capturing.
using System;

namespace easy_socket
{
    public class network_convert
    {
        public static ushort switch_ushort(ushort us)
        {
            return (ushort)((us>>8)+((us&0xff)<<8));
        }
        public static UInt32 switch_UInt32(UInt32 ui)
        {
            return (UInt32)((ui&0xff)<<24)
                +((ui&0xff00)<<8)
                +((ui&0xff0000)>>8)
                +((ui&0xff000000)>>24);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
France France

Comments and Discussions