Results 1 to 5 of 5

Thread: Socket component in progress

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Socket component in progress

    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:

    Code:
    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

    Code:
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272

  4. #4

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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...
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width