singrdk/base/Contracts/NetStack.Contracts/TCPContract.sg

39 lines
983 B
Plaintext
Raw Normal View History

2008-03-05 09:52:00 -05:00
///////////////////////////////////////////////////////////////////////////////
//
// Microsoft Research Singularity
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: TcpContract.sg
2008-11-17 18:29:00 -05:00
//
2008-03-05 09:52:00 -05:00
// Note: Contract definition for TCP channels
//
using Microsoft.Singularity.Directory;
namespace NetStack.Contracts
{
public contract TcpContract : ServiceContract
{
// The name you should use to look up this module using the NameServer.
2008-11-17 18:29:00 -05:00
public const string ModuleName = "/service/tcp";
2008-03-05 09:52:00 -05:00
// Signal our identity
out message Ready();
// Create a new TCP connection
in message CreateTcpSession(TcpConnectionContract.Exp:Start! endpoint);
out message Ack();
override state Start : one
{
Ready! -> ReadyState;
}
state ReadyState : one
{
CreateTcpSession? -> Ack! -> ReadyState;
}
}
}