i've got a project wherein the server listens only from one client on one port...i want a program to make the server lsiten to multiple clients on same port or different ports...watever....can anyone help me out. the foll is my Server side Code
Private Sub cmdStartListening_Click()
'listens for client requests
On Error GoTo error_handle_for_listening
' In case there is any error, this will jump to the
' "error_handle_for_listening" section
Winsock1.Close
' We close it in case its listening before
Winsock1.LocalPort = txtPortno.Text
' Local port of the winsock control is the text value entered in "txtPortno"
Winsock1.Listen
'Start listening
Exit Sub
error_handle_for_listening:
'Block for error handeling
MsgBox "Error : " & Err.Description, vbCritical
'This will display the error generated by the winsock control.
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
'This function is used to handle the connection initiation be the client
'This event is triggered when a client try to connect on our host
'We must accept the request for the connection to be completed
If Winsock1.State <> sckClosed Then Winsock1.Close
'Check if the state of the winsock connection
'If the state is closed, then the Connection is closed
Winsock1.Accept requestID
'With this we can accept the connection from the clients &
'then start sending / receiving the Data
rtbMainConsole.Text = " Client Connected. IP = " & Winsock1.RemoteHostIP & vbCrLf
'Display the Client connected & its IP address
rtbMainConsole.SelStart = Len(rtbMainConsole)
'This is used to autoscroll down the Main Chat Console
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
'This is being trigger every time new data arrive from the client
Dim strData As String
'The incomming data is received & saved in this variable
Winsock1.GetData strData, vbString
'The wisock connection is received here
rtbMainConsole.Text = rtbMainConsole.Text & "Client : " & strData & vbCrLf
'Displays the received data in the main chat console
rtbMainConsole.SelStart = Len(rtbMainConsole)
'This is used to autoscroll down the Main Chat Console
End Sub
This is it....also i need to send data files..is it possible to do it using the "winsock data arrival function" in my program...jus a query i wanted to clarify