当前位置: 首页>>代码示例>>Java>>正文


Java EReader类代码示例

本文整理汇总了Java中com.ib.client.EReader的典型用法代码示例。如果您正苦于以下问题:Java EReader类的具体用法?Java EReader怎么用?Java EReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EReader类属于com.ib.client包,在下文中一共展示了EReader类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startMsgProcessingThread

import com.ib.client.EReader; //导入依赖的package包/类
private void startMsgProcessingThread() {
	final EReaderSignal signal = new EJavaSignal();		
	final EReader reader = new EReader(client(), signal);
	
	reader.start();
	
	new Thread() {
		@Override
		public void run() {
			while (client().isConnected()) {
				signal.waitForSignal();
				try {
					reader.processMsgs();
				} catch (IOException e) {
					error(e);
				}
			}
		}
	}.start();
}
 
开发者ID:qerio,项目名称:goib,代码行数:21,代码来源:ApiController.java

示例2: createReader

import com.ib.client.EReader; //导入依赖的package包/类
/** Replace the input stream with ont that logs all data to m_inLogger. */
@Override public EReader createReader(EClientSocket socket, DataInputStream dis) {
	try {
		Field realIsField = FilterInputStream.class.getDeclaredField( "in");
		realIsField.setAccessible( true);
		InputStream realIs = (InputStream)realIsField.get( dis);
		realIsField.set( dis, new MyIS( realIs) );
	}
	catch( Exception e) {
		e.printStackTrace();
	}
	return super.createReader(socket, dis);
}
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:14,代码来源:ApiConnection.java

示例3: onConnect

import com.ib.client.EReader; //导入依赖的package包/类
void onConnect() {
    m_bIsFAAccount = false;
    // get connection parameters
    ConnectDlg dlg = new ConnectDlg( this);
    dlg.setVisible(true);
    if( !dlg.m_rc) {
        return;
    }

    // connect to TWS
    m_disconnectInProgress = false;
    
    m_client.OptionalCapabilities(dlg.m_retOptCapts);
    m_client.eConnect( dlg.m_retIpAddress, dlg.m_retPort, dlg.m_retClientId);
    if (m_client.isConnected()) {
        m_TWS.add("Connected to Tws server version " +
                   m_client.serverVersion() + " at " +
                   m_client.TwsConnectionTime());
    }
    
    m_reader = new EReader(m_client, m_signal);
    
    m_reader.start();
   
    new Thread() {
    	public void run() {
    		processMessages();
    		
    		int i = 0;
    		System.out.println(i);
    	}
    }.start();
}
 
开发者ID:qerio,项目名称:goib,代码行数:34,代码来源:SampleFrame.java

示例4: main

import com.ib.client.EReader; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
	EWrapperImpl wrapper = new EWrapperImpl();
	
	final EClientSocket m_client = wrapper.getClient();
	final EReaderSignal m_signal = wrapper.getSignal();
	//! [connect]
	m_client.eConnect("127.0.0.1", 7496, 0);
	//! [connect]
	//! [ereader]
	final EReader reader = new EReader(m_client, m_signal);        
       reader.start();        
       new Thread() {
       	public void run() {
       		while (m_client.isConnected()) {
    			m_signal.waitForSignal();
   				try {
   					reader.processMsgs();
   				} catch (Exception e) {
   					System.out.println("Exception: "+e.getMessage());
   				}
       		}
       	}
       }.start();
       //! [ereader]
       Thread.sleep(1000);
	
	//orderOperations(wrapper.getClient(), wrapper.getCurrentOrderId());
	//contractOperations(wrapper.getClient());
       //hedgeSample(wrapper.getClient(), wrapper.getCurrentOrderId());
       //testAlgoSamples(wrapper.getClient(), wrapper.getCurrentOrderId());
       //bracketSample(wrapper.getClient(), wrapper.getCurrentOrderId());
	//bulletins(wrapper.getClient());
       //reutersFundamentals(wrapper.getClient());
       //marketDataType(wrapper.getClient());
       //historicalDataRequests(wrapper.getClient());
       //accountOperations(wrapper.getClient());
	
	Thread.sleep(100000);
	m_client.eDisconnect();
}
 
开发者ID:qerio,项目名称:goib,代码行数:41,代码来源:Testbed.java


注:本文中的com.ib.client.EReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。