Click here to Skip to main content
Click here to Skip to main content
Go to top

TCP/IP With VB.Net - version 2(more power-more ease)

, 1 Jun 2005
Rate this:
Please Sign up or sign in to vote.
Exposes one of the most easy to use .net assembly for giving TCP/IP functionalities to any .Net environment

Sample screenshot

Introduction

Here it is. (Thanks to <- uno sh4re -> for coding sh*t)
Finally UnoLibs.Net V2 is done, and special Example app is made for CodeProject.
Remember this sh*t is released under GNU LGPL, this means you can use it for
whatever, including commercial.

1.UnoLibs.Net.dll / What is it?

UnoLibs.Net.dll is one of most easy to use library for giving TCP/IP functionalities to your .net app.

NO DEAL WITH THREADS AND SOCKETS(it's full managed)
No need of system.windows namespace( means you can use it for interfaceless application such as a .net console application )
What you get is a small set(3) or highly cusomizable classes wich can be used with ease, including a multithreaded server.

C# Programmers can use this library as well as VB.net users, usage steps are the same and the code needed is very easy to intend for using in c#.
(C# documentation would come in some time if some ask)

It exposes 3 Classes just made for being easy:ServerClass, ClientClass, ServerScanner.
The Article Shows one usage of theese classes, as they are implemented in the Example Application code.

2.What will i find in the Downloads?

-ExampleApp.Zip :This one contains the compiled versione of the example
                        You can download this, execute and and try it on your
                        localIP (loopback connection), or also you can install
                        it in more computer and test it over a network.
  
-ULNSource.zip  : This one contains a compiled version of the library and a
                         VS.NET solution specially made for CodeProject.
                   
                         The solution is made of 2 projects:
                          -UnoLibs.Net
                          -Example App
                          Of course Example App references to UnoLibs.Net

Both Also contains EvID4226Patch.exe wich let u modify the max number of simultaneous halfopened connection wich is limited to 15 in many new Os (2000/XP/2003), this is required in order to get the scanner working with more than 15 threads Smile | :) .

3.How do i use this?

To use UnoLibs.Net, just follow 3 easy steps
  1 Download any of the avaiable downloads and get UnoLibs.dll out of the zip file
  2 In Visual Studio, Add the reference to UnoLibs.dll
  Your project can now use the classes exposed by the assembly.
  3 Have fun using the classes with ease.

The usage is very easy and the references should be chomprensive of any important
information, however i'll write here topic usage for all of the 3 classes exposed.

4.Usage

Please note that this page shows (in the code snippets) ALL of the code
needed for getting the class to work and use them, no more code is needed.

ClientClass Usage

Create the ClientClass Instance

Dim Client As New UNOLibs.Net.ClientClass

Sending messages(bytes/data) to any server on specified IP/PORT is very easy.

Client.SendMessage(IP, PORT, DATA)

Sending files to specified IP/PORT is very easy.

Client.SendFiles(IP, PORT, dialog.FileNames)

That's it for the client!!!

ServerClass Usage

Create the ServerClass Instance (Withevents is specified for using "handles" clause later)

Dim WithEvents Server As UNOLibs.Net.ServerClass

Initialize the server on specified PORT(auto retrieves local IP) is very easy, using true will autostart the server and "C:\" is the Path for saving incoming files.

Server = New UNOLibs.Net.ServerClass(PORT, True, "C:\")

Now you need to catch Incoming Messages from IPs, easily do this with a sub
that handles the incoming message event of the ServerClass.

Private Sub OnIncomingMessage(ByVal Args As UNOLibs.Net.ServerClass.InMessEvArgs)Handles Server.IncomingMessage
        'sender IP
        Dim sip As String = Args.senderIP
        Dim DATA As String = Args.message
        'And you stuff here
        'If DATA.equals(........
End Sub

Note here that you can implement a similar handles sub also for capturing Diagnostics Messages for example to know when a file transfer session begins or ends(see the exampleapp code for more infos)

Changing the path for incoming file is easy.

Server.IncomingPath = "C:\Incoming Files"

That's it for the server.

ServerScanner Usage

Create the instance of ServerScanner

Dim WithEvents Scanner As UNOLibs.Net.ServerScanner

What to do when IPs are found on the specified PORT?
most probably something like that.

Private Sub OnIPFound(ByVal IP As String) Handles Scanner.IPfound
        'Me.FoundIPList.Items.Add(IP)
        'Me.FoundIPList.Refresh()
End Sub

Hmmmm let's start the scan

Scanner.StartScan()

That's It for the ServerScanner

NOTE on ServerScanner : If you are interested in catching perform bar step and scan finished events please refer to the very easy Example APP code.

5.Interesting Part

  -With a couple of lines of code you get a multithreaded server that will start
   a new process every 100 ms for processing eventually pending connections.
  -Since old V1, UnoLibs.Net makes a smart usage of the events so that you can
   execute your code with ease "on event"
  -NEW IN V.2
  -Fixed some bugs for the scanner class and improved scanning, can now be selected
   number of threads and timout (for xp sp2 users tcp fix patch required)
  -Added a fast and easy SEND FILES function for client
  -Added surely other minor bugs :P....

6.More about UnoLibs

UnoLibs are a collection of free (LGPL/Similar) tools and .net libraries.
Some are made by unoTeam, some are directly referenced thanks to the authors
and some are only linked.
   
The entire project (just begun!)is hosted at Http://www.freewebs.com/unoteam
  
Main idea is to always have a complete-non repetitive SET of multipurpose and
reusable libraries for any kind of use, always at hand.

Key feature for any tool/library of the UnoLibs is the ease of use and reuse-ability.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

uno freeware
Web Developer
Italy Italy
...picture was not for codeproject hihihi.
well my usual way is to release only classes wich can be used by you very easily and quickly.

Comments and Discussions

 
QuestionServer is binding to wrong IP on my PC, PinmemberCraig H23627-Jan-14 10:45 
QuestionWhere is the source code download? PinmemberTim_102417-Jan-13 2:49 
QuestionRe: Where is the source code download? PinmemberMember 96701931-Apr-13 11:44 
AnswerRe: Where is the source code download? PinmemberTim_102411-Apr-13 2:06 
GeneralRe: Where is the source code download? Pinmemberjak6455-Jul-14 7:34 
GeneralRe: Where is the source code download? Pinmembermmminchia28-Aug-14 11:43 
QuestionHow to send a string array? PinmemberAldrin Jay Morales22-Sep-12 18:53 
GeneralMax connections [modified] PinmemberMichael Timmermans18-Jul-12 23:56 
QuestionThank you Pinmemberforkee11-Jul-12 6:02 
QuestionAttempted Download PinmemberMember 90429867-Jul-12 15:22 
GeneralMy vote of 5 Pinmembermanoj kumar choubey24-Feb-12 2:47 
BugCrash on "unknown connection" Pinmemberxerax13-Dec-11 1:07 
GeneralRe: Crash on "unknown connection" Pinmemberuno freeware5-Apr-12 11:49 
GeneralRe: Crash on "unknown connection" Pinmemberayman metwally30-Dec-13 20:40 
BugVirus reported! PinmemberLeoKiz2-Nov-11 10:27 
BugDownload Pinmembermichaelbarb4-Oct-11 10:39 
GeneralRe: Download Pinmemberuno freeware5-Oct-11 4:22 
GeneralRe: Download Pinmembermichaelbarb5-Oct-11 5:19 
QuestionReceiving Data from the Client? Pinmemberantonio62228-Jan-11 19:31 
AnswerRe: Receiving Data from the Client? PinmemberCrook_EVB4-Apr-11 22:56 
GeneralMy vote of 5 Pinmemberiamgowda16-Dec-10 22:59 
GeneralLooking for info, or a better solution [modified] PinmemberCrook_EVB19-Nov-10 23:26 
RantPackage Virus PinmemberTwaitsey1-Nov-10 10:10 
GeneralRe: Package Virus Pinmemberuno freeware4-Nov-10 10:58 
GeneralAgain Pinmemberuno freeware20-Aug-10 4:29 
GeneralRe: Again PinmemberCrook_EVB4-Apr-11 3:56 
GeneralRe: Again Pinmemberuno freeware4-Apr-11 6:48 
GeneralRe: Again PinmemberCrook_EVB4-Apr-11 9:35 
QuestionSendfiles Progressbar ? Pinmemberabensrhir6-Aug-10 3:36 
AnswerRe: Sendfiles Progressbar ? Pinmemberuno freeware20-Aug-10 4:30 
Questionerror in sending files Pinmembermonicasegundo1-Mar-10 11:52 
GeneralMy vote of 1 Pinmembercomasic24-Sep-09 9:51 
GeneralRe: My vote of 1 Pinmemberuno freeware23-Dec-09 2:39 
GeneralRe: My vote of 1 Pinmemberuno freeware23-Dec-09 2:44 
QuestionCross-thread error ? Pinmemberdpcons11-Aug-09 10:22 
GeneralChange the IP of the listner to anothert device PinmemberTim Norton15-Jul-09 15:29 
GeneralOverload resolution failed because no accessible 'Send' can be called without a narrowing conversion PinmemberMohammad Al Hoss16-Apr-09 5:01 
GeneralRe: Overload resolution failed because no accessible 'Send' can be called without a narrowing conversion Pinmemberuno freeware16-Apr-09 7:44 
QuestionTCP and timer problem Pinmembertommasopit18-Mar-09 0:22 
AnswerRe: TCP and timer problem Pinmemberuno freeware18-Mar-09 0:58 
GeneralRe: TCP and timer problem Pinmembertommasopit18-Mar-09 1:31 
GeneralInternet working Pinmemberrgccvieira2-Dec-08 16:14 
GeneralProblems with receiving a message Pinmembermatzensens7-Oct-08 4:04 
QuestionSend file over Gprs PinmemberBadoxo21-Sep-08 15:45 
Questionbetter than just on a lan? Pinmemberejf286-May-08 15:48 
Questionproblems when sending file PinmemberGuoi10-Jan-08 17:47 
GeneralError when connected wih IE. Pinmemberkung_kaset451-Jan-08 9:51 
GeneralRe: Error when connected wih IE. Pinmemberuno freeware3-Jan-08 11:26 
QuestionWhere have the Source files gone? PinmemberPerryM7-Dec-07 13:39 
QuestionMultiple File Sending Pinmembernikkivalerio14-Nov-07 18:16 

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 | Mobile
Web04 | 2.8.140916.1 | Last Updated 1 Jun 2005
Article Copyright 2005 by uno freeware
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid