| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using GSG.NET.Concurrent;
- using NetMQ;
- using NetMQ.Sockets;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OHVLoggerTest
- {
- public class NetMq
- {
- PublisherSocket pub = null;
- ThreadCancel threadCancel = new ThreadCancel();
- public NetMq()
- {
- pub = new PublisherSocket();
- pub.Bind( "tcp://127.0.0.1:5565" );
- threadCancel.AddGo( Th_Pub );
- }
- void Th_Pub()
- {
- while ( !this.threadCancel.Canceled )
- {
- LockUtils.Wait( 1000 );
- this.pub.SendMoreFrame( "1000" ).SendFrame( "Test" );
- LockUtils.Wait( 100 );
- }
- }
- }
- }
|