Click here to Skip to main content
Click here to Skip to main content

Network Stuff (easy socket v3)

, 2 Jun 2005
Rate this:
Please Sign up or sign in to vote.
A class with event handlers for TCP, UDP or ICMP sockets; includes ping, traceroute, whois, ARP, and IPHelper functions and raw packets forging/ capturing.

Because of errors between VS 2002 and 2003, I've decided to put the two projects to solve resx and obsolete warning troubles.

Sample Image - networkstuff.jpg


This code contains a class for socket: ICMP, TCP, UDP, raw TCP, raw UDP, raw IP, and a class for IPHelper functions. All the classes for socket are made with the same view: provide handler for events like connected, closed, closed_by_remote_side, data_arrival, error ....

The sample project is included in beta version, it provides a graphical interface for Telnet, ping, traceroute, whois, packet capture, packet forging, scanning, viewing stats (IPHelper sample), sending ARP, DNS, wake and shutdown on LAN.

How to use

See the following sample for TCP:

easy_socket.tcp.Socket_Data clt;
clt=new easy_socket.tcp.Socket_Data();

// add events
clt.event_Socket_Data_Closed_by_Remote_Side+= new 
clt.event_Socket_Data_Connected_To_Remote_Host +=new 
clt.event_Socket_Data_DataArrival +=new 
// connect

// handlers
protected void 
    socket_closed_by_remote_side(easy_socket.tcp.Socket_Data sender, 
    EventArgs e)

  // handler code

protected void 
    socket_connected_to_remote_host(easy_socket.tcp.Socket_Data sender, 
    EventArgs e)
  // handler code

protected void socket_data_arrival(easy_socket.tcp.Socket_Data sender, 
                         easy_socket.tcp.EventArgs_ReceiveDataSocket e)
    string strdata=System.Text.Encoding.Default.GetString(e.buffer, 
                                                0, e.buffer_size );

protected void socket_error(easy_socket.tcp.Socket_Data sender, 
                         easy_socket.tcp.EventArgs_Exception e)
    string strerror=e.exception.Message;

As you can see, you can save a lot of time using these classes.


  • 28 Feb 05 - updated VS.NET 2003 source code.
  • 09 May 05
    • Began Telnet protocol implementation.
    • Interactive TCP/UDP added.
    • Some bug corrections.
  • 03 Jun 05
    • Stat graphs added.
    • Interface improvement.
    • Telnet horizontal tab bug removed.
    • More bug corrections.


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


About the Author

Comments and Discussions

Bughelp! shutdown() can't make FD_CLOSE sometimes,It's make the main program dead Pinmemberthserve14-Jul-12 22:35 
GeneralFInding my own Extrenal IP address PinmemberAlexEvans30-Jan-09 19:58 
GeneralRe: FInding my own Extrenal IP address PinmemberSaksida Bojan24-Aug-09 20:00 
GeneralARP returned MAC is not correct on Vista Pinmemberkelly_liu25-Aug-08 8:24 
GeneralRe: ARP returned MAC is not correct on Vista Pinmemberkelly_liu25-Aug-08 8:35 
Questionplease help me .. Pinmembermicrogroup21-Oct-07 0:37 
GeneralVS 2005 PinmemberSniper16720-Jul-07 13:10 
GeneralRe: VS 2005 PinmemberRanjan.D15-Aug-07 4:38 
GeneralRe: VS 2005 Pinmembervbytesdc30-Sep-07 11:20 
GeneralRe: VS 2005 Pinmemberanimalishuang15-Nov-07 23:03 
GeneralNot thread safe! PinmemberGreg Cadmes11-Sep-06 8:28 
I was going to give a thumbs up, but realized there are some serious threading issues with the VS 2003 source. BTW, i am using VS2005.

Two thumbs down!!!

Greg Cadmes

Greg cadmes
GeneralRe: Not thread safe! Pinmemberrantanplanisback11-Sep-06 11:14 
Generalgreat job Pinmemberanimalishuang22-Jul-06 23:32 
GeneralPacket generation Pinmembersimon.wellborne9-Jun-05 19:26 
Generaltcp client server Pinmembervbytesdc5-Jun-05 20:29 
GeneralRe: tcp client server Pinmemberrantanplanisback7-Jun-05 9:15 
GeneralRe: tcp client server PinmemberUnruled Boy7-Jun-05 16:53 
Generalmissing types PinmemberUnruled Boy3-Jun-05 17:15 
GeneralRe: missing types Pinmemberrantanplanisback7-Jun-05 9:12 
GeneralRe: missing types PinmemberUnruled Boy7-Jun-05 16:52 
GeneralRe: missing types Pinmemberyezie26-Apr-06 22:23 
Generalarp_header error PinmemberRoelf17-May-05 4:49 
GeneralRe: arp_header error PinsussAnonymous17-May-05 11:39 
Generalarp_header error PinmemberRoelf17-May-05 4:46 
QuestionHow could we act on Routing Table? PinsussAnonymous16-May-05 6:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150414.1 | Last Updated 3 Jun 2005
Article Copyright 2004 by rantanplanisback
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid