mobile based application connect to PC!!!
i'm writing a chatting application for PDA, below is my code for establish connection to computer(the ip address is the router ip address)........but i still new for mobile programming....now i ask for some opinion whether it will work in PDA or not?
VB Code:
Const mBufferSize As Integer = 255
Private mBuffer(mBufferSize) As Byte
Private sendBuffer(mBufferSize) As Byte
Public Shared mSocket As Socket
Public Sub Connect()
mSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
mSocket.BeginConnect(New IPEndPoint(IPAddress.Parse("192.168.0.111"), 8080), AddressOf Connected, mSocket)
End Sub
Public Sub Connected(ByVal ar As IAsyncResult)
mSocket = DirectCast(ar.AsyncState, Socket)
mSocket.EndConnect(ar)
MsgBox("Connected")
mSocket.BeginReceive(mBuffer, 0, mBufferSize, SocketFlags.None, AddressOf getMessage, mSocket)
End Sub
Re: mobile based application connect to PC!!!
I posted a set of classes that I use to do something like that in your post in the .NET forum. There are a few differences in the socket settings, but compare the two.