Sha256: e457eec6a8d228ef6fd8ac1ca24bc6d0ae0ff93121bdb52eac0dda6fb87d550e

Contents?: true

Size: 1.72 KB

Versions: 16

Compression:

Stored size: 1.72 KB

Contents

/**
 * $Id$
 * 
 * Author:: Francis Cianfrocca (gmail: blackhedd)
 * Homepage::  http://rubyeventmachine.com
 * Date:: 15 Jul 2007
 * 
 * See EventMachine and EventMachine::Connection for documentation and
 * usage examples.
 * 
 *
 *----------------------------------------------------------------------------
 *
 * Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
 * Gmail: blackhedd
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of either: 1) the GNU General Public License
 * as published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version; or 2) Ruby's License.
 * 
 * See the file COPYING for complete licensing information.
 *
 *---------------------------------------------------------------------------
 *
 * 
 */



package com.rubyeventmachine;

//import java.io.*;
import java.nio.*;
import java.net.*;
//import java.nio.channels.*;

public class Connection {
	
	public Application application;
	public String signature;
	
	public void postInit() {}
	public void connectionCompleted() {}
	public void unbind() {}
	public void receiveData (ByteBuffer bytebuffer) {}
	
	
	/**
	 * Called by user code.
	 * @param bytebuffer
	 */
	public void sendData (ByteBuffer b) {
		application.sendData(signature, b);
	}
	
	/**
	 * This is called by user code.
	 * TODO: don't expose the exception here.
	 */
	public void close() {
		application.closeConnection(signature, false);
	}
	/**
	 * This is called by user code/
	 */
	public void closeAfterWriting() {
		application.closeConnection(signature, true);
	}
	
	public void sendDatagram (ByteBuffer bb, InetSocketAddress addr) {
		application.sendDatagram (signature, bb, addr);
	}
}

Version data entries

16 entries across 16 versions & 5 rubygems

Version Path
careo-eventmachine-0.12.5.1 java/src/com/rubyeventmachine/Connection.java
davidsmalley-eventmachine-0.12.3.1 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.3 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.4 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.5 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.6 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.7 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.8 java/src/com/rubyeventmachine/Connection.java
eventmachine-eventmachine-0.12.9 java/src/com/rubyeventmachine/Connection.java
libc-eventmachine-0.12.5.42 java/src/com/rubyeventmachine/Connection.java
libc-eventmachine-0.12.7.42 java/src/com/rubyeventmachine/Connection.java
eventmachine-0.12.6 java/src/com/rubyeventmachine/Connection.java
eventmachine-0.12.6-java java/src/com/rubyeventmachine/Connection.java
eventmachine-0.12.4 java/src/com/rubyeventmachine/Connection.java
eventmachine-0.12.8-java java/src/com/rubyeventmachine/Connection.java
eventmachine-0.12.8 java/src/com/rubyeventmachine/Connection.java