send CTRL+C over socket to server

There is a server and i can telnet on it from client,then i can send commands to server from telnet console.if i want to send two or more commands,i must press ctrl+c to over currently command and then send next command.

i will do these operate above with JAVA program,but the problem is i don't know how to send ctrl+c over socket to server :-(

Is there anybody can help me?how can i do it? THANKS

[418 byte] By [blackflya] at [2007-10-2 21:16:19]
# 1
You need to look up & implement the Telnet protocol to get this entire thing working:ftp://ftp.rfc-editor.org/in-notes/rfc854.txtCtrl/C is implemented as {IP,Sync}, which must be sent via TCP 'urgent data', i.e. Socket.sendUrgentData().
ejpa at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 2
-_-!thank ejp.however,I don't know how i can do it. could you expain it more particular?THX
blackflya at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 3
1. Read the RFC.2. Look up Socket.sendUrgentData().
ejpa at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 4

hi,ejp

i have seen some document about the function Socket.sendUrgentData,and i think i doesn't describe the question clearly.in fact overing command is Server's job,and i needn't to know how does the Server do to over the command,what i need to do is only sending a some information to Server that have effect like press "CTRL+C" at telnet client console.

but i don't know how to send the information and what form of the information is.

blackflya at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 5
I don't have the faintest idea what you mean by 'overing command', or the rest of the sentence that contains it, but if you think there isn't enough information in the references I cited to implement your requirement you are mistaken.
ejpa at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 6
overing command.........maybe finish command,close command or end command-_-! my English is poor,I'm sorry
blackflya at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 7
OK well you send the information with Socket.sendUrgentData(), and the form of the data is defined in the RFC. Wasn't that clear?
ejpa at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...
# 8
Doesn't jakarta commons have a telnet class?
jschella at 2007-7-14 0:24:26 > top of Java-index,Archived Forums,Socket Programming...