Socket problem
-
Im trying to send command trought TCP-IP to a remote application. I use something like this :
Dim myIpHostInfo As IPHostEntry = Dns.Resolve(strIP) Dim myIPAdress As IPAddress = myIpHostInfo.AddressList(0) Dim myRemoteEP As New IPEndPoint(myIPAdress, strPort) Dim bytesSent As Integer Dim mySender As New Sockets.Socket(Sockets.AddressFamily.InterNetwork, Sockets.SocketType.Stream, Sockets.ProtocolType.Tcp) mySender.Connect(myRemoteEP) Dim Key As System.Windows.Forms.Keys Dim CommandTest As Byte() = System.Text.Encoding.ASCII.GetBytes("/createdoc(NewDocument, 210 mm, 297 mm, 12 mm, 12 mm, 12 mm,12 mm, 0, 1, 5 pt, 0)" & Key.Enter & Key.LineFeed)
I know im connected but every command i send does not do anything and return anything. :confused: Can it be possible that the fact i send in bytes and not String is the cause ? Maybe Winsock could handle that ? X| I am a newbie