This commit is contained in:
@@ -149,6 +149,7 @@ public class SncpTest {
|
|||||||
{
|
{
|
||||||
setName("Thread-Server-01");
|
setName("Thread-Server-01");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -157,7 +158,7 @@ public class SncpTest {
|
|||||||
if (port2 > 0) set.add(new InetSocketAddress(myhost, port2));
|
if (port2 > 0) set.add(new InetSocketAddress(myhost, port2));
|
||||||
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
||||||
final Transport transport = new Transport("", WatchFactory.root(), newBufferPool(), newChannelGroup(), null, set);
|
final Transport transport = new Transport("", WatchFactory.root(), newBufferPool(), newChannelGroup(), null, set);
|
||||||
SncpTestService service = Sncp.createLocalService("", null, SncpTestService.class, addr, transport, null);
|
SncpTestService service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, addr, transport, null);
|
||||||
ResourceFactory.root().inject(service);
|
ResourceFactory.root().inject(service);
|
||||||
server.addService(new ServiceWrapper(SncpTestService.class, service, "", "", new HashSet<>(), null));
|
server.addService(new ServiceWrapper(SncpTestService.class, service, "", "", new HashSet<>(), null));
|
||||||
System.out.println(service);
|
System.out.println(service);
|
||||||
@@ -182,6 +183,7 @@ public class SncpTest {
|
|||||||
{
|
{
|
||||||
setName("Thread-Server-02");
|
setName("Thread-Server-02");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -190,7 +192,7 @@ public class SncpTest {
|
|||||||
set.add(new InetSocketAddress(myhost, port));
|
set.add(new InetSocketAddress(myhost, port));
|
||||||
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
||||||
final Transport transport = new Transport("", WatchFactory.root(), newBufferPool(), newChannelGroup(), null, set);
|
final Transport transport = new Transport("", WatchFactory.root(), newBufferPool(), newChannelGroup(), null, set);
|
||||||
Service service = Sncp.createLocalService("", null, SncpTestService.class, addr, transport, null);
|
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, addr, transport, null);
|
||||||
server.addService(new ServiceWrapper(SncpTestService.class, service, "", "", new HashSet<>(), null));
|
server.addService(new ServiceWrapper(SncpTestService.class, service, "", "", new HashSet<>(), null));
|
||||||
AnyValue.DefaultAnyValue conf = new AnyValue.DefaultAnyValue();
|
AnyValue.DefaultAnyValue conf = new AnyValue.DefaultAnyValue();
|
||||||
conf.addValue("host", "0.0.0.0");
|
conf.addValue("host", "0.0.0.0");
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class SncpTestService implements SncpTestIService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
Service service = Sncp.createLocalService("", null, SncpTestService.class, new InetSocketAddress("127.0.0.1", 7070), null, null);
|
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, new InetSocketAddress("127.0.0.1", 7070), null, null);
|
||||||
for (Method method : service.getClass().getDeclaredMethods()) {
|
for (Method method : service.getClass().getDeclaredMethods()) {
|
||||||
System.out.println(method);
|
System.out.println(method);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user