Niklas Therning wrote:
>
> ezzat wrote:
>> hello all,
>>
>> in my company, a Socket-server application made by the
>> apache-mina package.
>> i have a task to connect to this server and get some information first I
>> trying to logging in then if logging is true, I try to send request and
>> get
>> the server response I tried to make this , but I have many problems using
>> the ordinary java socket or channelScoket
>> the problem, I can't get all the response message of the server.
>> can any body help me to get out of this task how can I starting
>>
>
> I think you will have to provide some more information. What does the
> server do? Is it a standard protocol like HTTP, FTP, etc, or a
> proprietary? If proprietary, please give us some details of what the
> protocol looks like. Also, what does your client code look like?
> /Niklas
>
its a TCP socket.
the server collect some data and send to clients.
I'm a client , so I send loggin message th server, if true, I logged in..
after looging I start to send a request and receive a response from the
server.
I used the socket class of java and SocketChannel, but with same problem..
the 2 are blocking sockets, i.e I can read all the data in the response
message of the server.
this code
mySocket = new Socket(getHost(), getPort());
os = new DataOutputStream(mySocket.getOutputStream());
os.write(getAuthenticationDateString());
os.flush();
Thread.sleep(500); // must sleep a while to get the
server response
DataInputStream is = new
DataInputStream(mySocket.getInputStream());
int nn = is.available();
// the available function get number of bytes that can
be read without blocking
if(nn > 0)
{
byte[] bb = new byte[nn];
is.read(bb);
returnString = decryptReturnedResponse(bb);
}
System.out.println(returnString);
this code get some of the reseived data.
the question is how can I get all the response message that server sent
?????????
waiting your reply
--
View this message in context:
http://www.nabble.com/socket-problem-tf4682668s16868.html#a13381282
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.