PDA

Click to See Complete Forum and Search --> : Socket component in progress


Cander
Mar 11th, 2002, 11:35 AM
hey guys. I am working on a dll for Socket connections that will contain functionality for common internet communication

Here is what the break down of namespaces/class will be:


Sockets.TCP
Sockets.TCP.TCPServer
Sockets.TCP.TCPClient

Sockets.FTP
Sockets.FTP.FTPServer
Sockets.FTP.FTPClient



And so on for some otehr possible connection types.

If anyone has any ideas/code or whatever, please let me know. I am in big need of System.Net.Sockets sample code. Not much out there at the moment.

here is what little I have so far


Namespace Sockets
' All socket connection types
Namespace TCP
Imports System.Net.Sockets
' For TCP comm
Public Class TCPServer
' For TCP servers
Private m_Port As Integer
Private tcpConn As TcpClient

Public Sub Listen()
' Start Listening for incoming connections
Dim tcpListener As New TcpListener(m_Port)

tcpListener.Start()

Try
' Accept a connecting client
tcpConn = tcpListener.AcceptTcpClient()
Catch e As Exception
End Try
End Sub

Public Sub SendData(ByVal strData As String)
' Server sending to client
End Sub

Property Port() As Integer
' Port property
Get
Return m_Port
End Get
Set(ByVal Value As Integer)
m_Port = Value
End Set
End Property
End Class
End Namespace
End Namespace

Cander
Mar 11th, 2002, 01:25 PM
update..

In desperate need of code to get the ip address of a connected client in the server class for the ClientIP read only property I am adding.

If anyone knows or finds this ..let me know.

thinktank2
Mar 11th, 2002, 04:20 PM
http://www.dotnetextreme.com/code/GETComputernameandIP.asp

Cander
Mar 11th, 2002, 05:21 PM
no..it has to be for getting the ip of a ermotly conencted client

like what you egt when you are writing a server with winsock and you use winsock1.RemoteHostIP

Cander
Mar 12th, 2002, 08:42 AM
Almost done with Ping...w00t! I should hopefully have it done before the end of the week if anyone wants to help test the ICMP functions..

Oh and it uses Raw sockets...not cheaply shelling out to the console calling ping.exe...its ping in full VB .NET code.


I hope to create an entire suite of socket components..time permitting...