|
-
Feb 2nd, 2000, 05:02 AM
#1
I am writing a chat program but for some reason the basic connection won't even work. The Client end of the program says "No Carrier: if anyone could figure out why I would greaty appreciate it.
I am posting the whole program just incase something is wrong that I am not looking at.
CLIENT
Private Sub cmdconnect_Click()
Cclient.RemotePort = 8760
Cclient.RemoteHost = "192.168.0.1"
Cclient.Connect
End Sub
Private Sub Cclient_DataArrival(ByVal bytestotal As Long)
Dim Fplace As Integer
Dim Splace As Integer
Dim Firstp As String
Dim Sendp As String
Dim Calias As String
Dim Addl As String
Fplace = InStr(1, Getrev, ":", vbTextCompare)
Splace = Fplace + 1
Firstp = Mid(Getrev, 1, Fplace)
Sendp = Mid(Getrev, Splace)
If Firstp = "alupdate:" Then
Alist.Clear
For Aupdate = 1 To Len(Sendp)
Addl = Mid(Sendp, Aupdate, 1)
If Addl = ";" Then
Alist.AddItem Calias
DoEvents
Calias = ""
Next Aupdate
End If
Calias = Calias & Addl
Next Aupdate
End If
If Firstp = "logrqst:" Then
Malias = "alias:Ualias"
Cclient.SendData Malias
End Sub
SERVER
Private Sub Form_Load()
intmax = 0
Cserver(0).LocalPort = 8760
Cserver(0).Listen
End Sub
Private Sub Cserver_ConnectionRequest_(index As Integer, ByVal requestID As Long)
intmax = intmax + 1
Load Cserver(intmax)
Cserver(intmax).LocalPort = 0
Cserver(intmax).Accept requestID
Cserver(intmax).SendData "logrqst:none"
End Sub
Private Sub Cserver_DataArrival(index As Integer, ByVal bytestotal As Long)
Cserver(index).GetData Getrev, vbString
Dim Fplace As Integer
Dim Splace As Integer
Dim Firstp As String
Dim Sendp As String
Fplace = InStr(1, Getrev, ":", vbTextCompare)
Splace = Fplace + 1
Firstp = Mid(Getrev, 1, Fplace)
Sendp = Mid(Getrev, Splace)
If Firstp = "alias:" Then Call Nalias(Sendp)
If Firstp = "chattxt:" Then Call txtupdate(Sendp)
End Sub
Thank You
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|