Click here to Skip to main content
11,408,708 members (59,850 online)
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

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 
AnswerRe: How could we act on Routing Table? PinsussAnonymous16-May-05 10:07 
GeneralRe: How could we act on Routing Table? PinsussAnonymous18-May-05 1:37 
GeneralHaving problem with packet forging... PinsussAnonymous3-May-05 2:24 
GeneralRe: Having problem with packet forging... [modified] PinmemberLandarzar11-Jun-06 23:43 
QuestionBlocking IP Packets? PinmemberMdg27-Apr-05 9:56 
GeneralGPL... PinmemberIGx8927-Mar-05 2:33 
GeneralRe: GPL... Pinmemberrantanplanisback29-Mar-05 7:49 
GeneralRe: GPL... PinmemberIGx8929-Mar-05 7:59 
GeneralRe: GPL... Pinmemberrantanplanisback29-Mar-05 9:42 
GeneralRe: GPL... PinmemberIGx8929-Mar-05 11:28 
Sorry for most CodeProject people...

All I'd like is to use the udp.Socket_Server class in a freeware program, without having to release the complete source code for the entire program. GPL certainly has its uses, but for entire programs; not for a simple class or two that make lives of hobbyist (or commercial) programmers easier Frown | :(
GeneralRe: GPL... Pinmemberpedrito6810-May-05 6:35 
GeneralRe: GPL... PinmemberRobert M. Bouwens9-May-05 20:58 
GeneralRe: GPL... PinmemberSean McCormack3-Jun-05 7:14 
GeneralRe: GPL... [modified] PinmemberRyan L. Schneider24-Jul-06 6:33 
GeneralTCP SYN SYN/ACK issues Pinmemberbanduraj15-Mar-05 9:56 
GeneralRe: TCP SYN SYN/ACK issues Pinmemberrantanplanisback22-Mar-05 12:24 
GeneralSource code formatting Suggestion Pinmembermrbelles27-Feb-05 19:17 
GeneralRe: Source code formatting Suggestion Pinmembermrbelles27-Feb-05 19:31 
GeneralRe: Source code formatting Suggestion Pinsussjacquelin.potier3-Mar-05 11:32 
GeneralRe: Source code formatting Suggestion PinmemberUnruled Boy9-May-05 19:41 
GeneralGot 1 errors, 3 Warning Pinsussanonymous....29-Jan-05 4:40 
GeneralRuntime Exceptions Pinsussdfhgesart29-Jan-05 4:55 
GeneralRe: Runtime Exceptions Pinsussjacquelin.potier8-Feb-05 2:50 
GeneralRe: Got 1 errors, 3 Warning Pinsussjacquelin.potier5-Feb-05 6:36 
QuestionDid anyone got similar error ? Pinmemberscott_wu21-Dec-04 18:08 
GeneralTCPSniffer Pinmemberynik15-Oct-04 2:50 
GeneralRe: TCPSniffer PinsussAnonymous15-Oct-04 8:30 
GeneralMissing Resources Pinmemberkiddjoe11-Oct-04 7:00 
GeneralRe: Missing Resources Pinmemberrantanplanisback11-Oct-04 9:54 
GeneralRe: Missing Resources Pinmemberrantanplanisback12-Oct-04 9:48 
QuestionWarning CS0618. Can i fix it? PinmemberAngel Tsvetkov11-Oct-04 1:31 
AnswerRe: Warning CS0618. Can i fix it? Pinmemberrantanplanisback11-Oct-04 9:51 
GeneralRe: Warning CS0618. Can i fix it? Pinmemberrantanplanisback12-Oct-04 9:47 
GeneralCapturing tcp Pinmemberynik8-Oct-04 6:29 
GeneralRe: Capturing tcp Pinmemberrantanplanisback8-Oct-04 7:11 
GeneralRe: Capturing tcp Pinmemberynik8-Oct-04 7:22 
GeneralRe: Capturing tcp Pinmemberrantanplanisback11-Oct-04 9:58 
GeneralRe: Capturing tcp Pinmemberynik11-Oct-04 10:32 
GeneralRe: Capturing tcp Pinmemberrantanplanisback11-Oct-04 11:07 
GeneralRe: Capturing tcp Pinmemberdfhgesart18-Feb-05 6:51 
GeneralRe: Capturing tcp Pinmembericer139-Oct-05 5:52 
GeneralOther errors as well...... PinmemberKeith Vinson6-Oct-04 9:14 
GeneralRe: Other errors as well...... Pinmemberrantanplanisback6-Oct-04 10:02 
GeneralRe: Other errors as well...... PinmemberKeith Vinson6-Oct-04 10:35 
GeneralRe: Other errors as well...... Pinmemberrantanplanisback7-Oct-04 7:18 
GeneralRe: Other errors as well...... PinmemberKeith Vinson7-Oct-04 7:24 
GeneralError! Pinsussgidora6665-Oct-04 21:53 

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.5 | Last Updated 3 Jun 2005
Article Copyright 2004 by rantanplanisback
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid