Package com.google.code.or.net

Examples of com.google.code.or.net.TransportContext


  /**
   *
   */
  public void login(Transport transport) throws IOException {
    //
    final TransportContext ctx = transport.getContext();
    LOGGER.info("start to login, user: {}, host: {}, port: {}", new Object[]{this.user, ctx.getServerHost(), ctx.getServerPort()});
   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    s.writeInt(20, 1); // the length of the SHA1 encrypted password
    s.writeBytes(MySQLUtils.password41OrLater(this.password.getBytes(this.encoding), ctx.getScramble().getBytes(this.encoding)));
    if(this.initialSchema != null) s.writeNullTerminatedString(StringColumn.valueOf(this.initialSchema.getBytes(this.encoding)));
   
    //
    final RawPacket request = new RawPacket();
    request.setSequence(1);
View Full Code Here


  /**
   *
   */
  public void login(Transport transport) throws IOException {
    //
    final TransportContext ctx = transport.getContext();
    LOGGER.info("start to login, user: {}, host: {}, port: {}", new Object[]{this.user, ctx.getServerHost(), ctx.getServerPort()});
   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    s.writeInt(20, 1); // the length of the SHA1 encrypted password
    s.writeBytes(MySQLUtils.password41OrLater(this.password.getBytes(this.encoding), ctx.getScramble().getBytes(this.encoding)));
    if(this.initialSchema != null) s.writeNullTerminatedString(StringColumn.valueOf(this.initialSchema.getBytes(this.encoding)));
   
    //
    final RawPacket request = new RawPacket();
    request.setSequence(1);
View Full Code Here

TOP

Related Classes of com.google.code.or.net.TransportContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.