I have to establish a TCP connection to a server, which requires that I send the credential to logon in the format:
<STX>username=fred&password=123456<ETX>
Let's say host: qstage.thetcphost.com and port:8999
I am new to socket programming and using the same to implement this. I have used java.net.Socket
at the client side but I dont know how do I send the above string for authentication to the TCP Server in Java.
I am able to telnet the server now.
But how do I pass the credential string in the < STX >...< ETX > format after (or during): Socket socket = new Socket("mshxml.morningstar.com", 8999); I mean what is the piece of code that I have to write to authenticate myself to the TCP server?
I have searched this site for this info but could not find any. Help would be greatly appreciated.