Does anyone how to make blitzbasic TCP/UDP protocol talk to winsock (windows\system32\mswinsck.ocx)?
Blitzbasic TCP/UDP & Winsock compatibility?
Blitz3D Forums/Blitz3D Programming/Blitzbasic TCP/UDP & Winsock compatibility? Further info:
My goal is to create a server using winsock in VB and a client using blitzbasic.
Heres my code so far:
VB CODE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Load()
Winsock1.LocalPort = "1329"
Winsock1.Listen
Label1.Caption = "waiting for connection..."
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
Label1.Caption = "connected..."
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Label1.Caption = "data"
Label2.Caption = data
Label3.Caption = Len(data)
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BLITZ CODE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print "waiting"
WaitKey()
Print "trying to connect"
stream=OpenTCPStream("127.0.0.1",1329)
If stream<>0 Then
Print "Connected!"
Else
Print "failed to connect"
WaitKey()
End If
send$=Input(">")
WriteString stream,"testing testing 123"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I can make them connect successfully, and when i send data the server recognizes that its recieving it but it does not read it correctly. Any ideas?
My goal is to create a server using winsock in VB and a client using blitzbasic.
Heres my code so far:
VB CODE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Load()
Winsock1.LocalPort = "1329"
Winsock1.Listen
Label1.Caption = "waiting for connection..."
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
Label1.Caption = "connected..."
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Label1.Caption = "data"
Label2.Caption = data
Label3.Caption = Len(data)
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BLITZ CODE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print "waiting"
WaitKey()
Print "trying to connect"
stream=OpenTCPStream("127.0.0.1",1329)
If stream<>0 Then
Print "Connected!"
Else
Print "failed to connect"
WaitKey()
End If
send$=Input(">")
WriteString stream,"testing testing 123"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I can make them connect successfully, and when i send data the server recognizes that its recieving it but it does not read it correctly. Any ideas?
what is wrong with the data ? maybe its a problem with the var types. Dont know anything about VB, but have you ever tried to send just bytes or zero terminated strings (WriteLine) ?
tried that but i didnt manage to get any results. i do have an idea though: make a server in blitzbasic and a client in vb and have the client send data to the vb server. kind of like solving an algebra problem backwards
i tested my theory above and get the same problem: it recognizes that data has been sent but cannot read the data. help!
dont understand what your doing .. did you send data from the VB-Client to a Blitz-Server ? If not, this could be a good way to analyse how VB handles the datatypes(network stream).
yea but i cant get it to work