I'm writing two console applications, one client and one server I'm stuck in a couple of things, which It seemed easy ..
# 1: I want to write a function for the following code, which converts bits into a string, but I can not understand it. The server always crashes when I use it My job is slightly different from this one, but this is because the connection information in my current code is included, and I think a better way to do this The method is:
byte [] b = new byte [100]; Int k = s.Receive (b); String packet = faucet; For (int i = 0; i & lt; k; i ++) {console.light (convert tokker (b [ii])); Packet = packet + convert Toker (b [ii]); }
I think the function is not a problem, but how do I use it
byte [] b = new byte [100]; EDIT: I am calling and using it this way:
byte [] b = new byte [100]; String Response = Bit Convert (B);
# 2 I want the customer to send packets only once with a password. And if that password does not match the password described in the server, it should close the connection with the client.
I know how to send the packet once, but I do not know the packet for every client on the server once.
Or in other words, there is no way to know the server at this time that the client has already been certified. So I think the customer needs some type of socket id, and the server needs a table with the ID, and to see if it's automatic or not, boolean.
The first part of getting the bytes in the string ...
Byte B [] = new byte [100]; Int k = s.Receive (b, b.Length, 0); String packet = encoding. ASCII.getString (b, 0, k);
Part 2 ... do not know from above my head
Comments
Post a Comment