Click here to Skip to main content
12,302,493 members (66,797 online)
Click here to Skip to main content
Add your own
alternative version


131 bookmarked

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

You may also be interested in...

Comments and Discussions

Bughelp! shutdown() can't make FD_CLOSE sometimes,It's make the main program dead Pin
thserve14-Jul-12 21:35
memberthserve14-Jul-12 21:35 
GeneralFInding my own Extrenal IP address Pin
AlexEvans30-Jan-09 18:58
memberAlexEvans30-Jan-09 18:58 
GeneralRe: FInding my own Extrenal IP address Pin
Saksida Bojan24-Aug-09 19:00
memberSaksida Bojan24-Aug-09 19:00 
GeneralARP returned MAC is not correct on Vista Pin
kelly_liu25-Aug-08 7:24
memberkelly_liu25-Aug-08 7:24 
GeneralRe: ARP returned MAC is not correct on Vista Pin
kelly_liu25-Aug-08 7:35
memberkelly_liu25-Aug-08 7:35 
Questionplease help me .. Pin
microgroup20-Oct-07 23:37
membermicrogroup20-Oct-07 23:37 
GeneralVS 2005 Pin
Sniper16720-Jul-07 12:10
memberSniper16720-Jul-07 12:10 
GeneralRe: VS 2005 Pin
Ranjan.D15-Aug-07 3:38
memberRanjan.D15-Aug-07 3:38 
GeneralRe: VS 2005 Pin
vbytesdc30-Sep-07 10:20
membervbytesdc30-Sep-07 10:20 
GeneralRe: VS 2005 Pin
animalishuang15-Nov-07 22:03
memberanimalishuang15-Nov-07 22:03 
GeneralNot thread safe! Pin
Greg Cadmes11-Sep-06 7:28
memberGreg Cadmes11-Sep-06 7:28 
GeneralRe: Not thread safe! Pin
rantanplanisback11-Sep-06 10:14
memberrantanplanisback11-Sep-06 10:14 
Generalgreat job Pin
animalishuang22-Jul-06 22:32
memberanimalishuang22-Jul-06 22:32 
GeneralPacket generation Pin
simon.wellborne9-Jun-05 18:26
membersimon.wellborne9-Jun-05 18:26 
Generaltcp client server Pin
vbytesdc5-Jun-05 19:29
membervbytesdc5-Jun-05 19:29 
GeneralRe: tcp client server Pin
rantanplanisback7-Jun-05 8:15
memberrantanplanisback7-Jun-05 8:15 
GeneralRe: tcp client server Pin
Unruled Boy7-Jun-05 15:53
memberUnruled Boy7-Jun-05 15:53 
Generalmissing types Pin
Unruled Boy3-Jun-05 16:15
memberUnruled Boy3-Jun-05 16:15 
GeneralRe: missing types Pin
rantanplanisback7-Jun-05 8:12
memberrantanplanisback7-Jun-05 8:12 
GeneralRe: missing types Pin
Unruled Boy7-Jun-05 15:52
memberUnruled Boy7-Jun-05 15:52 
GeneralRe: missing types Pin
yezie26-Apr-06 21:23
memberyezie26-Apr-06 21:23 
Generalarp_header error Pin
Roelf17-May-05 3:49
memberRoelf17-May-05 3:49 
GeneralRe: arp_header error Pin
Anonymous17-May-05 10:39
sussAnonymous17-May-05 10:39 
Generalarp_header error Pin
Roelf17-May-05 3:46
memberRoelf17-May-05 3:46 
QuestionHow could we act on Routing Table? Pin
Anonymous16-May-05 5:49
sussAnonymous16-May-05 5:49 
AnswerRe: How could we act on Routing Table? Pin
Anonymous16-May-05 9:07
sussAnonymous16-May-05 9:07 
GeneralRe: How could we act on Routing Table? Pin
Anonymous18-May-05 0:37
sussAnonymous18-May-05 0:37 
GeneralHaving problem with packet forging... Pin
Anonymous3-May-05 1:24
sussAnonymous3-May-05 1:24 
GeneralRe: Having problem with packet forging... [modified] Pin
Landarzar11-Jun-06 22:43
memberLandarzar11-Jun-06 22:43 
QuestionBlocking IP Packets? Pin
Mdg27-Apr-05 8:56
memberMdg27-Apr-05 8:56 
GeneralGPL... Pin
IGx8927-Mar-05 1:33
memberIGx8927-Mar-05 1:33 
GeneralRe: GPL... Pin
rantanplanisback29-Mar-05 6:49
memberrantanplanisback29-Mar-05 6:49 
GeneralRe: GPL... Pin
IGx8929-Mar-05 6:59
memberIGx8929-Mar-05 6:59 
GeneralRe: GPL... Pin
rantanplanisback29-Mar-05 8:42
memberrantanplanisback29-Mar-05 8:42 
GeneralRe: GPL... Pin
IGx8929-Mar-05 10:28
memberIGx8929-Mar-05 10:28 
GeneralRe: GPL... Pin
pedrito6810-May-05 5:35
memberpedrito6810-May-05 5:35 
GeneralRe: GPL... Pin
Robert M. Bouwens9-May-05 19:58
memberRobert M. Bouwens9-May-05 19:58 
GeneralRe: GPL... Pin
Sean McCormack3-Jun-05 6:14
memberSean McCormack3-Jun-05 6:14 
GeneralRe: GPL... [modified] Pin
Ryan L. Schneider24-Jul-06 5:33
memberRyan L. Schneider24-Jul-06 5:33 
GeneralTCP SYN SYN/ACK issues Pin
banduraj15-Mar-05 8:56
memberbanduraj15-Mar-05 8:56 
GeneralRe: TCP SYN SYN/ACK issues Pin
rantanplanisback22-Mar-05 11:24
memberrantanplanisback22-Mar-05 11:24 
GeneralSource code formatting Suggestion Pin
mrbelles27-Feb-05 18:17
membermrbelles27-Feb-05 18:17 
GeneralRe: Source code formatting Suggestion Pin
mrbelles27-Feb-05 18:31
membermrbelles27-Feb-05 18:31 
Sorry, I realize that I did not provide you with any decent resources to help aim you in the right direction, should you so choose to look into my suggestions.

Here's link that will provide you with best practice guidelines for naming conventions and a host of other coding topics. Whether you agree with my thoughts or not, this will help you to understand my perspective.

Ps. I dig your efforts, and I gave you 5 regardless of not reading your update. I have read your code in the past, and you demonstrated a good working knowledge of a host of networking topics. And, simply because I love all efforts in network programming! Keep coding! This thread is merely a suggestion on formatting, not a flame!

Only those who attempt the absurd, can achieve the impossible.
GeneralRe: Source code formatting Suggestion Pin
jacquelin.potier3-Mar-05 10:32
sussjacquelin.potier3-Mar-05 10:32 
GeneralRe: Source code formatting Suggestion Pin
Unruled Boy9-May-05 18:41
memberUnruled Boy9-May-05 18:41 
GeneralGot 1 errors, 3 Warning Pin
anonymous....29-Jan-05 3:40
sussanonymous....29-Jan-05 3:40 
GeneralRuntime Exceptions Pin
dfhgesart29-Jan-05 3:55
sussdfhgesart29-Jan-05 3:55 
GeneralRe: Runtime Exceptions Pin
jacquelin.potier8-Feb-05 1:50
sussjacquelin.potier8-Feb-05 1:50 
GeneralRe: Got 1 errors, 3 Warning Pin
jacquelin.potier5-Feb-05 5:36
sussjacquelin.potier5-Feb-05 5:36 
QuestionDid anyone got similar error ? Pin
scott_wu21-Dec-04 17:08
memberscott_wu21-Dec-04 17:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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.160530.1 | Last Updated 3 Jun 2005
Article Copyright 2004 by rantanplanisback
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid