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




Reply With Quote