PDA

Click to See Complete Forum and Search --> : Internet chat program


Daniel_Christie
Aug 15th, 2000, 09:41 AM
Can anyone steer or provide any hady tips for creating a chat software via networking protocals such as TCP/IP.

My friend and I want to create a software such as AIM and ICQ.
Any help would be greatly appreciated.

Daniel Christie

Sophtware
Aug 15th, 2000, 10:16 AM
I wanted to do the same as you but i just never finihsed the program:

'This code will only send messages from a client form to the server form.

Am sure you can figure out the details.


'Client:

Private Sub Command1_Click()
Winsock1.Connect "127.0.0.1", 1134
End Sub

Private Sub Command2_Click()
Dim Message As String
Message = Text1.Text
Winsock1.SendData Message
Text1.Text = ""
End Sub

Private Sub Form_Load()

End Sub

Private Sub Winsock1_Connect()
MsgBox "Yes!"
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckConnected Then Winsock1.Close
Winsock1.Accept requestID

End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Client As String
Winsock1.GetData Client, vbString
Text1.Text = Client
End Sub


'Server

Private Sub Command1_Click()
Winsock1.SendData Text1.Text
Text1.Text = ""
End Sub

Private Sub Form_Load()
Winsock1.LocalPort = 1134
Winsock1.Listen
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckConnected Then Winsock1.Close
Winsock1.Accept requestID

End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Message As String
Winsock1.GetData Message, vbString
Text1.Text = Message
End Sub

gwdash
Aug 15th, 2000, 01:47 PM
Too Samples come to mind, one in vb help for winsock, is a winsock based one. The other is in the DirectX SDK and is more complex, but better. It uses DirectPlay.

Hope this helps

SteveCRM
Aug 15th, 2000, 02:31 PM
I have a winsock demo on my site: http://www.stevescyberhome.net

the winsock control is really easy once you get the hang of it. If you want more help, email me.

btw: the email in my signature is wrong

SteveCRM@hotmail.com