Package common.connection

Examples of common.connection.ConnectionWriterInterface


  public void sendNickname()
  {
    int protocolId = PeerProtocol.PROTOCOL_CHAT;
    int opcode = PeerProtocol.Chat.OP_NICKNAME;
    sendOverlapped(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeUTF(Settings.application.nickname);
      }
View Full Code Here


  {
    final Object results = getSharedFilesTable().query(keywords);

    int protocolId = ClientServerProtocol.PROTOCOL_FILES;
    int opcode = ClientServerProtocol.Files.OP_RESULTS;
    connection.send(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeInt(cookie);
        os.writeObject(results);
View Full Code Here

  public void sendMessage(final String message)
  {
    int protocolId = PeerProtocol.PROTOCOL_CHAT;
    int opcode = PeerProtocol.Chat.OP_MESSAGE;
    connection.send(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeUTF(message);
      }
View Full Code Here

  private void sendFiles(final MultiNamedFile file)
  {
    int protocolId = ClientServerProtocol.PROTOCOL_FILES;
    int opcode = ClientServerProtocol.Files.OP_ADD_FILE;
    connection.sendOverlapped(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeObject(file);
      }
View Full Code Here

  public void onRemove(final SerializableFile file)
  {
    int protocolId = ClientServerProtocol.PROTOCOL_FILES;
    int opcode = ClientServerProtocol.Files.OP_DEL_FILE;
    connection.sendOverlapped(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeObject(file);
      }
View Full Code Here

    public void sendMessage(final String message)
    {
      int protocolId = ClientServerProtocol.PROTOCOL_CHAT;
      int opcode = ClientServerProtocol.Chat.OP_POST_MESSAGE;
      getConnection().send(protocolId, opcode, new ConnectionWriterInterface()
      {
        public void run(ObjectOutputStream os) throws IOException
        {
          os.writeUTF(message);
        }
View Full Code Here

  private void sendFile(ServerConnection connection, final MultiNamedFile file)
  {
    int protocolId = ClientServerProtocol.PROTOCOL_FILES;
    int opcode = ClientServerProtocol.Files.OP_ADD_FILE;
    connection.send(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeObject(file);
      }
View Full Code Here

    transitTo(DownloadStatus.QUERYING);

    int protocolId = ClientServerProtocol.PROTOCOL_FILES;
    int opcode = ClientServerProtocol.Files.OP_GET_SOURCES;
    serverConnection.sendOverlapped(protocolId, opcode,
        new ConnectionWriterInterface()
        {
          public void run(ObjectOutputStream os) throws IOException
          {
            os.writeObject(file);
            os.writeBoolean(false);
View Full Code Here

  public void sendChatMessage(final String sender, final String message)
  {
    int protocolId = ClientServerProtocol.PROTOCOL_CHAT;
    int opcode = ClientServerProtocol.Chat.OP_MESSAGE_POSTED;
    send(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeUTF(sender);
        os.writeUTF(message);
View Full Code Here

  public void sendKeywords(final int cookie, final Collection<String> keywords)
  {
    int protocolId = ClientServerProtocol.PROTOCOL_FILES;
    int opcode = ClientServerProtocol.Files.OP_KEYWORDS;
    send(protocolId, opcode, new ConnectionWriterInterface()
    {
      public void run(ObjectOutputStream os) throws IOException
      {
        os.writeInt(cookie);
        os.writeObject(keywords);
View Full Code Here

TOP

Related Classes of common.connection.ConnectionWriterInterface

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.