Client and Server (DirectX)

Size: px
Start display at page:

Download "Client and Server (DirectX)"

Transcription

1 Client and Server (DirectX) Vishnu Kotrajaras Server scalability Your game can handle more players at a time (Over internet, most peer-topeer can only handle about 6 players) All depend on server power Too many people-> just upgrade server (client does not have to do much configuration) 1

2 Firewalls Peer-to-peer needs many holes in the firewall, but firewalls allow only a few ports to open Client/server only needs one port open Simplicity Clients only worry about themselves Server can be left with a simple interface Server can run on many OS 2

3 IDirectPlay8Server Interface Initialize COM with CoInitialize() Then it must be created with CoCreateInstance() The methods are like what you ve seen for peers IDirectPlay8Server functions (1) Initialize- sets up the interface to receive messages for connections Close- disconnects and closes the server from the current session Host- creates the session in which clients can connect 3

4 IDirectPlay8Server functions (2) SendTo- transmits data to one or many players within the session EnumServiceProviders- enumerates service providers available to the server SetApplicationDesc- changes particular application settings for an existing session CreateGroup- creates a new group to which players can be added DestroyGroup IDirectPlay8Server functions (3) AddPlayerToGroup RemovePlayerFromGroup GetGroupInfo GetClientInfo DestroyClient GetClientAddress- get DPlay address string for a client 4

5 IDirectPlay8Server functions (4) GetLocalHostAddresses- get DPlay address used to host the local server GetSendQueueInfo- monitors the send message queue for a particular client GetConnectionInfo- gets info about the connection with a particular client GetApplicationDesc After CoCreateInstance() of server Init IDirectPlay8Server Message Handler (all messages will be sent here) HRESULT Initialize( PVOID Const pvusercontext, PFNDPNMESSAGEHANDLER pfn, DWORD dwflags ); Pointer to message handler The only flag is DPNINITIALIZE_DISABLEPARAMVAL Disable parameter validation, but normally we won t use it 5

6 After Initialize() Set up device address (for the host) Set the address service provider The code is very similar to the code for peers hosting 1. Set up the server info with SetServerInfo() 2. Set up application description with the DPN_APPLICATION_DESC data structure 3. Set up the address to handle things with AddComponent() 4. Call the Host() function 6

7 SetServerInfo() Server info, e.g.name HRESULT SetServerInfo( const DPN_PLAYER_INFO *const pdpnplayerinfo, PVOID const pvasyncontext, User context (opt) DPNHANDLE *const phasynchandle, const DWORD dwflags ) DPNSETSERVERINFO_SYNC ->process synchronously // // Setup our player information // DXUtil_ConvertGenericStringToWide( wszservername, "DPChat Server" ); ZeroMemory( &dpplayerinfo, sizeof(dpn_player_info) ); dpplayerinfo.dwsize = sizeof(dpn_player_info); dpplayerinfo.dwinfoflags = DPNINFO_NAME; dpplayerinfo.pwszname = wszservername; // Set us up to be non-asynchronous if( FAILED( hreturn = g_pdpserver- >SetServerInfo( &dpplayerinfo, NULL, NULL, DPNSETSERVERINFO_SYNC ) ) ) { MessageBox( hwindow, "Failed to SetServerInfo()", "Unknown Error", MB_ICONERROR ); return -1; 7

8 Set up DPN_APPLICATION_DESC Use just like you used peers, but dwflags change to DPNSESSION_CLIENT_SERVER // Setup the application description DXUtil_ConvertGenericStringToWide( wszsessionname, "DPChat Session" ); ZeroMemory( &dnappdesc, sizeof(dpn_application_desc) ); dnappdesc.dwsize = sizeof(dpn_application_desc); dnappdesc.guidapplication = GUID_CHATSERVER; dnappdesc.pwszsessionname = wszsessionname; dnappdesc.dwmaxplayers = MAX_PLAYERS; dnappdesc.dwflags = DPNSESSION_CLIENT_SERVER; 8

9 Set up the address Need to add server s host port number Clients communicate through here // Tell the port number // Add port number to host address // hreturn = g_pdeviceaddress- >AddComponent(DPNA_KEY_PORT,&dwPort,sizeof(DWORD),DPNA_ DATATYPE_DWORD); if( hreturn!= S_OK ) { MessageBox( hwindow, "Failed to AddComponent()", "hrhostgame()", MB_ICONERROR ); return -1; Host() HRESULT Host( const DPN_APPLICATION_DESC *const pdnappdesc, ); How many devices in the second parameter IDirectPlay8Address **const prgdeviceinfo, const DWORD cdeviceinfo, const DPN_SECURITY_DESC *const pdpsecurity, The app.desc you created Device you just added port number const DPN_SECURITY_CREDENTIALS *const pdpcredentials, VOID *const pvplayercontext, const DWORD dwflags Hosting flags Optional user context Not used by DirectX8 9

10 hreturn = g_pdpserver->host( &dnappdesc, &g_pdeviceaddress, 1, NULL, NULL, NULL, NULL ); if( FAILED( hreturn ) ) { MessageBox( hwindow, "Failed to Host()", "DirectPlay Error", MB_ICONERROR ); return -1; Managing Players When a player connects to your game, he passes you a creation message You need to add him to your table of active players 10

11 HRESULT hrcreateplayer( PVOID pvusercontext, PVOID pmsgbuffer ) { HRESULT hreturn = S_OK; PDPNMSG_CREATE_PLAYER pcreateplayermsg; char strname[256]; char szoutput[256]; DWORD dwsize = 0; DPN_PLAYER_INFO *pdpplayerinfo = NULL; int i; // Get a Create Message pointer to the buffer pcreateplayermsg = (PDPNMSG_CREATE_PLAYER)pMsgBuffer; // Get the peer info and extract its name hreturn = g_pdpserver->getclientinfo( pcreateplayermsg->dpnidplayer, pdpplayerinfo, &dwsize, 0 ); if( FAILED(hReturn) && hreturn!= DPNERR_BUFFERTOOSMALL ) { if( hreturn == DPNERR_INVALIDPLAYER ) { vshowtext(hlb_output,"adding Ourselves"); hreturn = -1; GET SIZE else { pdpplayerinfo = (DPN_PLAYER_INFO*) new BYTE[ dwsize ]; ZeroMemory( pdpplayerinfo, dwsize ); pdpplayerinfo->dwsize = sizeof(dpn_player_info); hreturn = g_pdpserver->getclientinfo( pcreateplayermsg- >dpnidplayer, pdpplayerinfo, &dwsize, 0 ); if( FAILED(hReturn) ) { USE THE SIZE THAT WE GET FOR THE 2 ND CALL 11

12 HRESULT GetClientInfo( const DPNID dpnid, // belongs to the client that we want info DPN_PLAYER_INFO *const pdpnplayerinfo, //this will hold the soon- to- //be-retrieved player info DWORD *const pdwsize, //size of the information retrieved. //If the buffer size is too small, //DPNERR_BUFFERTOOSMALL is returned const DWORD dwflags //DPNINFO_NAME or DPNINFO_DATA ); else { >pwszname ); >dpnidplayer; vshowtext(hlb_output,"error Getting Client Info"); hreturn = -1; EnterCriticalSection( &g_csmodifyplayer ); // Convert player name to ANSI DXUtil_ConvertWideStringToGeneric( strname, pdpplayerinfo- // Add player to list for( i = 0 ; i < MAX_PLAYERS ; i++ ) { if(!playerinfo[i].bactive ) { PlayerInfo[i].bActive = 1; PlayerInfo[i].dpnidPlayer = pcreateplayermsg- strcpy(playerinfo[i].szplayername,strname); break; // Check if no free slot found if( i == MAX_PLAYERS ) { 12

13 vshowtext(hlb_output,"no free slots in game!"); // Check if we are adding ourselves else if( pdpplayerinfo->dwplayerflags & DPNPLAYER_LOCAL ) { g_dpnidlocalplayer = pcreateplayermsg- >dpnidplayer; sprintf(szoutput,"<slot%d> Added Ourselves",i); vshowtext(hlb_output,szoutput); else { sprintf(szoutput,"<slot%d><%s> Is In The Game",i,strName); vshowtext(hlb_output,szoutput); SAFE_DELETE_ARRAY( pdpplayerinfo ); way // Update the number of active players in a thread safe if( i!= MAX_PLAYERS ) InterlockedIncrement( &g_lnumberofactiveplayers ); LeaveCriticalSection( &g_csmodifyplayer ); return hreturn; 13

14 Destroy Player Must check for DPN_MSGID_DESTROY_PLAYER CALL hrdestroyplayer() to process it HRESULT hrdestroyplayer( PVOID pvusercontext, PVOID pmsgbuffer ) { PDPNMSG_DESTROY_PLAYER pdestroyplayermsg; HRESULT hreturn = S_OK; int i; char szoutput[256]; // Get a Destroy Message pointer to the buffer pdestroyplayermsg = (PDPNMSG_DESTROY_PLAYER)pMsgBuffer; // Update the number of active players in a thread safe way InterlockedDecrement( &g_lnumberofactiveplayers ); EnterCriticalSection( &g_csmodifyplayer ); // Remove Player from list Use this, so that we can find the player s ID 14

15 for( i = 0 ; i < MAX_PLAYERS ; i++ ) { if( PlayerInfo[i].bActive ) { if( PlayerInfo[i].dpnidPlayer == pdestroyplayermsg->dpnidplayer ) { PlayerInfo[i].bActive = 0; sprintf(szoutput,"<slot%d><%s> Left The Game",i,PlayerInfo[i].szPlayerName); vshowtext(hlb_output,szoutput); break; LeaveCriticalSection( &g_csmodifyplayer ); return(hreturn); Receiving messages from DWORD dwtype; DWORD dwsize; client case DPN_MSGID_RECEIVE: { PDPNMSG_RECEIVE preceivemsg; PacketGeneric *PGen; In LoginDirectPlayMessageHandler preceivemsg = (PDPNMSG_RECEIVE)pMsgBuffer; PGen = (PacketGeneric*)pReceiveMsg->pReceiveData; // Ignore the packet if we sent it originally if( preceivemsg->dpnidsender == g_dpnidlocalplayer ) break; // If it is a chat packet, send it out to all of the players if( PGen->dwType == PACKET_TYPE_CHAT ) { Defined by us in DPChatServer.h as a subclass of PacketGeneric. It has array of char (storing actual chat message) as an extra field 15

16 >preceivedata; void *packet; PacketChat *ChatMsg; // Convert the packet to a void stream ChatMsg = (PacketChat*)pReceiveMsg- packet = (VOID*)ChatMsg; // Send the chat packet to all clients hrsendservermessage(dpnid_all_players_group,p ACKET_TYPE_CHAT,packet); // Output it on our screen vshowtext(hlb_output,chatmsg- >sztext); break; hrsendservermessage() HRESULT hrsendservermessage( int player, //slot number that you want to send the message //to. Use DPNID_ALL_PLAYERS_GROUP to //send message to all clients DWORD dwmessagetype, //message type, defined in //DPChatServer.h PVOID pmsgbuffer //void pointer to the contents of the //message. Void pointer allows any type //of data for this parameter ); 16

17 HRESULT hrsendservermessage( int player, DWORD dwmessagetype, PVOID pmsgbuffer ) { DPNHANDLE hasync; DWORD dwlength; DPN_BUFFER_DESC bufferdesc; PacketGeneric *PGen; // Cast to a generic packet to get the size PGen = (PacketGeneric*)pMsgBuffer; dwlength = PGen->dwSize; if( dwlength == 0 ) return(0); Exit because we don t want to send empty message bufferdesc.dwbuffersize = dwlength; bufferdesc.pbufferdata = (BYTE*)pMsgBuffer; Set up buffer // Broadcast it if player set to zero if( player == DPNID_ALL_PLAYERS_GROUP ) g_pdpserver->sendto( DPNID_ALL_PLAYERS_GROUP, &bufferdesc, 1, 0, NULL, &hasync, DPNSEND_NOLOOPBACK ); else g_pdpserver->sendto( PlayerInfo[player].dpnidPlayer, &bufferdesc, 1, 0, NULL, &hasync, 0); return S_OK; SendTo() HRESULT SendTo( const DPNID dpnid, //client you want to send to const DPN_BUFFER_DESC *const pbufferdesc, //this is the actual message data const DWORD cbufferdesc, //how many msg buffers to //send with this call const DWORD dwtimeout, //time out, set to 0 if you want //to keep sending the lost message void *const pvasynccontext, //NULL DPNHANDLE *const phasynchandle, //can use it to cancel send //but if we set it to //DPNSEND_SYNC, this value //must be null const DWORD dwflags // SEE next page ); 17

18 SendTo -> flags (1) DPNSEND_GUARANTEED Guarantees message delivery DPNSEND_NOLOOPBACK Keeps the server from receiving its own messages DPNSEND_PRIORITY_LOW Queues the message with low priority DPNSEND_PRIORITY_HIGH Queues the message with high priority SendTo -> flags (2) DPNSEND_NOCOPY Keeps DirectPlay from making a copy of the DPN_BUFFER_DESC before sending the message. You cannot use DPNSEND_NOCOMPLETE with this DPNSEND_SYNC Process the send synchronously DPNSEND_NOCOMPLETE Keeps DPN_MSGID_SEND_COMPLETE message from being generated Cannot use DPNSEND_NOCOPY and DPNSEND_GUARANTEED flags with this one, and the async context must be set to null 18

19 SendTo -> flags (3) DPNSEND_NONSEQUENTIAL Lets messages arrive at the client s computer in any possible order -> only use this flag for non-critical packets DPNSEND_COMPLETEONPROCESS Causes DirectPlay to send a DPN_MSGID_SEND_COMPLETE message upon completion of a message being received by the client. You have to set the DPNSEND_GUARANTEED flag in conjunction with this flag IDirectPlay8 Client interface Initialize and do things as before 19

20 HRESULT hrinitializedirectplay( HWND hwindow ) { HRESULT hreturn; // Initialize COM hreturn = CoInitialize( NULL ); if( FAILED(hReturn) ) { MessageBox( hwindow, "Error Initializing COM", "DirectPlay Error", MB_ICONERROR ); return hreturn; // Create IDirectPlay8Client Object if( FAILED( hreturn = CoCreateInstance( CLSID_DirectPlay8Client, NULL, CLSCTX_INPROC_SERVER, IID_IDirectPlay8Client, (LPVOID*) &g_pdp ) ) ) MessageBox( hwindow, "Can't Create DPlayClient", "DirectPlay Error", MB_ICONERROR ); // Init IDirectPlay8Client Message Handler if( FAILED( hreturn = g_pdp->initialize( NULL, DirectPlayMessageHandler, 0 ) ) ) { MessageBox( hwindow, "Failed to Message Handler", "DirectPlay Error", MB_ICONERROR ); return -1; // Create a device address hreturn = CoCreateInstance( CLSID_DirectPlay8Address, NULL,CLSCTX_INPROC_SERVER, IID_IDirectPlay8Address, (LPVOID*) &g_pdeviceaddress ); if( FAILED(hReturn) ) { MessageBox( hwindow, "Failed to Create Device", "CoCreateInstance()", MB_ICONERROR ); return -1; // Set our service provider to TCP/IP if( FAILED( hreturn = g_pdeviceaddress->setsp( &CLSID_DP8SP_TCPIP ) ) ) { MessageBox( hwindow, "Failed to SetSP() for Device Address", "Invalid Param", MB_ICONERROR ); return -1; 20

21 // Create a host address hreturn = CoCreateInstance( CLSID_DirectPlay8Address, NULL,CLSCTX_INPROC_SERVER, IID_IDirectPlay8Address, (LPVOID*) &g_phostaddress ); if( FAILED(hReturn) ) { MessageBox( hwindow, "Failed to Create Host Address()", "Invalid Param", MB_ICONERROR ); return -1; // Set the host address to TCP/IP if( FAILED( hreturn = g_phostaddress->setsp( &CLSID_DP8SP_TCPIP ) ) ) { MessageBox( hwindow, "Failed to SetSP() for Host Address", "Invalid Param", MB_ICONERROR ); return -1; // Create connection complete event for later use g_hconnectcompleteevent = CreateEvent( NULL, FALSE, FALSE, NULL ); vshowtext(hlb_output,"<<--tcp INITED-->>"); return S_OK; Joining the server session A user click the join button -> msg is sent hrjoingame() is called 21

22 LRESULT CALLBACK fnmessageprocessor ( HWND hwnd, UINT imsg, WPARAM wparam, LPARAM lparam ) { char szmessage[256]; char szcompmessage[256]; char szmyname[32]; HRESULT hreturn; void *packet; PacketChat ChatMsg; switch (imsg) { case WM_COMMAND: { // Check for child window messages switch(loword(wparam)) { // Check if the user clicked the button case IDC_hBU_Join: hrjoingame( hwnd ); break; See next page HRESULT hrjoingame( HWND hwnd ) { HRESULT hreturn = S_OK; WCHAR wszhostname[256]; WCHAR wszclientname[256]; char szclientname[256]; char szip[256]; char szport[256]; DWORD dwport; DWORD dwlength = 256; DPN_APPLICATION_DESC dpnappdesc; DPN_PLAYER_INFO dpplayerinfo; vshowtext(hlb_output,"attempting Connection..."); // Set the Client info GetWindowText(hEB_InputName,szClientName,36); // Get name from Window Edit Box DXUtil_ConvertGenericStringToWide( wszclientname, szclientname ); 22

23 ZeroMemory( &dpplayerinfo, sizeof(dpn_player_info) ); dpplayerinfo.dwsize = sizeof(dpn_player_info); dpplayerinfo.dwinfoflags = DPNINFO_NAME; dpplayerinfo.pwszname = wszclientname; Setup info for the player who joins // Make this a synchronous call if( FAILED( hreturn = g_pdp->setclientinfo( &dpplayerinfo, NULL, NULL, DPNSETCLIENTINFO_SYNC ) ) ) { vshowtext(hlb_output,"failed to set client info"); return -1; // Prepare the application description ZeroMemory( &dpnappdesc, sizeof( DPN_APPLICATION_DESC ) ); dpnappdesc.dwsize = sizeof( DPN_APPLICATION_DESC ); dpnappdesc.guidapplication = GUID_CHATSERVER; If your client application s GUID does not match the server s Then a connection cannot be made HRESULT setclientinfo( const DPN_PLAYER_INFO *const pdpnplayerinfo, //stores player name and other info about client ); PVOID const pvasynccontext, //NULL DPNHANDLE *const phasynchandle, // a handle that lets you cancel //this operation const DWORD dwflags //1 flag -> DPNSETCLIENTINFO_SYNC, //which tells the function to process //synchronously 23

24 // Get IP from edit box GetWindowText(hEB_InputServerIP,szIP,32); // Get Port from edit box GetWindowText(hEB_InputServerPort,szPort,6); // Convert the IP to a wide string DXUtil_ConvertGenericStringToWide( wszhostname, szip ); // Convert the port string to a DWORD dwport = atol(szport); Created in hrinitializedirectplay() // Add host name to address hreturn = g_phostaddress- >AddComponent(DPNA_KEY_HOSTNAME,wszHostName,(wcslen( wszhostname)+1)*sizeof(wchar),dpna_datatype_string); if( hreturn!= S_OK ) { MessageBox( hwnd, "Failed to AddComponent()", "hrjoingame()", MB_ICONERROR ); return -1; // Add port number to address hreturn = g_phostaddress- >AddComponent(DPNA_KEY_PORT,&dwPort,sizeof(DWORD),D PNA_DATATYPE_DWORD); if( hreturn!= S_OK ) { MessageBox( hwnd, "Failed to AddComponent()", "hrjoingame()", MB_ICONERROR ); return -1; // Connect to the session hreturn = g_pdp->connect( &dpnappdesc, g_phostaddress, g_pdeviceaddress, NULL, NULL, NULL, NULL, NULL, &g_hconnectasyncop, NULL); // flags 24

25 if( hreturn!= E_PENDING && FAILED(hReturn) ) { vshowtext(hlb_output,"failed to Connect"); return -1; SetTimer( hwnd, TIMERID_CONNECT_COMPLETE, 100, NULL ); return(hreturn); HRESULT Connect( const DPN_APPLICATION_DESC *const pdnappdesc, //the application description we set up earlier ) IDirectPlay8Address *const phostaddr, //host address interface IDirectPlay8Address *const pdeviceinfo, //device address for the client //connection that you defined in //hrinitializedirectplay() const DPN_SECURITY_DESC *const pdnsecurity, //for future, therefore //NULL const DPN_SECURITY_CREDENTIALS *const pdncredentials, //NULL const void *const pvuserconnectdata, //send additional connect information to //the server. If you specify this, the //server receives a //DPN_MSGID_INDICATE_CONNECT //message const DWORD dwuserconnectdatasize, //size of the 6 th parameter void *const pvasynccontext, //user created context to be passed when //DPN_MSGID_CONNECT_COMPLETE message is //processed DPHANDLE *const phasynchandle, //must be NULL if you set //DPNCONNECT_SYNC const DWORD dwflags // has DPCONNECT_OKTOQUERYFORADDRESSING //and DPCONNECT_SYNC to set 25

26 Set up the connection timer Let it goes off every 0.1 second i.e. the system sends a WM_TIMER message to the main message loop every 0.1 second This saves the program from having to do a loop-intensive waiting The part of the code that handles WM_TIMER is in fnmessageprocessor() Check if this is the timer that we created case WM_TIMER: if( wparam == TIMERID_CONNECT_COMPLETE ) { // Check if the message is telling us our connection is complete if( WAIT_OBJECT_0 == WaitForSingleObject( g_hconnectcompleteevent, 0 ) ) { if( FAILED( g_hrconnectcomplete ) ) { vshowtext(hlb_output,"<<----connection IN-COMPLETE---->>"); else { vshowtext(hlb_output,"<<----connection COMPLETE---->>"); KillTimer( hwnd, TIMERID_CONNECT_COMPLETE ); break; This is returned if the event passed in is complete (apart from this, the event can have flag for success or failure) 26

27 In DirectPlayMessageHandler(), DPN_MSGID_CONNECT_COMPLETE is received by clientr once the server has accepted the connection When you get this message, you should signal the g_hconnectcompleteevent with the SetEvent() Before you do that it is best to set the return state of the connection to find out whether the server accepted or rejected the connection case DPN_MSGID_CONNECT_COMPLETE: { PDPNMSG_CONNECT_COMPLETE pconnectcompletemsg; pconnectcompletemsg = (PDPNMSG_CONNECT_COMPLETE)pMsgBuffer; g_hrconnectcomplete = pconnectcompletemsg->hresultcode; SetEvent( g_hconnectcompleteevent ); break; 27

28 Sending messages to the server Look in fnmessageprocessor() switch(hiword(wparam)) { case EN_UPDATE: // Get the text from the edit box GetWindowText(hEB_InputField,szMessage,256); // Check if they pressed enter if( szmessage[strlen(szmessage)-1] == 10 ) { // Get rid of trailing garbage szmessage[strlen(szmessage)-2] = '\0'; GetWindowText(hEB_InputName,szMyName,32); sprintf(szcompmessage,"<%s> %s", szmyname, szmessage); // clear input field SetWindowText(hEB_InputField,""); // // Send a chat packet to the server // ChatMsg.dwSize = sizeof(packetchat); ChatMsg.dwType = PACKET_TYPE_CHAT; strcpy(chatmsg.sztext,szcompmessage); // Convert the packet to a void stream packet = (VOID*)&ChatMsg; // Send the chat packet hreturn = hrsendclientmessage(packet_type_chat,packet); break; 28

29 HRESULT hrsendclientmessage( DWORD dwmessagetype, PVOID pmsgbuffer ) { DPNHANDLE hasync; DWORD dwlength; DPN_BUFFER_DESC bufferdesc; PacketGeneric *PGen; // Cast to a generic packet to get the size PGen = (PacketGeneric*)pMsgBuffer; dwlength = PGen->dwSize; if( dwlength == 0 ) return(0); bufferdesc.dwbuffersize = dwlength; bufferdesc.pbufferdata = (BYTE*)pMsgBuffer; g_pdp->send( &bufferdesc, 1, 0, NULL, &hasync, 0 ); return S_OK; Use Send() instead of SendTo() -client can only send to server, so no need to tell Who it sends to IDirectPlay8Client::Send() HRESULT Send( const DPN_BUFFER_DESC *const pbufferdesc, //the DPN_BUFFER_DESC data structure that contains the //message to send ) const DWORD cbufferdesc, //number of buffers passed in //the first parameter (currently //you can only send 1) const DWORD dwtimeout, //milliseconds, if 0-> keep sending void *const pvasynccontext, //NULL DPNHANDLE *const phasynchandle, //if you use //DPSEND_SYNC, you //must set this to NULL const DWORD dwflags //same as the flags of SendTo() 29

30 Review Server Initialize COM Create IDirectPlay8Server interface Create a device address Set TCP/IP as the service provider Set the server information using IDirectPlay8Server::SetServerInfo() Initialize the application description Add the port number to the device address Call the IDirectPlay8Server::Host() Client Initialize COM Create IDirectPlay8Client interface Create a device address Set TCP/IP as the service provider Create a host address Set TCP/IP as the service provider Create a completion event Set the client information using IDirectPlay8Client::SetClientInfo() Initialize the application description Add the host port number and IP address to the host address Call the IDirectPlay8Client::Connect() Set the connection timer to go off every 0.1 second 30

Creating a DirectX Project

Creating a DirectX Project Creating a DirectX Project A DirectPLay Chat Program Setting up your Compiler for DirectX Install DirectX SDK Make sure your compiler has path to directx8/include Directx8/lib Directx8/samples/multimedia/common/src

More information

DirectPlay. What is DirectPlay? Vishnu Kotrajaras, PhD

DirectPlay. What is DirectPlay? Vishnu Kotrajaras, PhD DirectPlay Vishnu Kotrajaras, PhD What is DirectPlay? It is a multiplayer component of DirectX It abstracts communication methods away Same function call for communication by TCP/IP, serial cable and modem

More information

Dealing with DirectPlay Environments under DirectX

Dealing with DirectPlay Environments under DirectX Iraqi Journal of Statistical Science (9) 2006 P.P. [75-90] Dealing with DirectPlay Environments under DirectX Aseel Waleed A. Al-Niamey * ABSTRACT The idea of this project is based on programming the functions

More information

UFG-10 MC. Frame Grabbers. Easy Programming Guide. Windows

UFG-10 MC. Frame Grabbers. Easy Programming Guide. Windows UFG-10 MC Frame Grabbers Easy Programming Guide Windows Copyright Introduction This manual, Copyright 2014 Unigraf Oy. All rights reserved Reproduction of this manual in whole or in part without written

More information

Programming in graphical environment. Introduction

Programming in graphical environment. Introduction Programming in graphical environment Introduction The lecture Additional resources available at: http://www.mini.pw.edu.pl/~maczewsk/windows_2004 Recommended books: Programming Windows - Charles Petzold

More information

[MC-DPL8CS]: DirectPlay 8 Protocol: Core and Service Providers. Intellectual Property Rights Notice for Open Specifications Documentation

[MC-DPL8CS]: DirectPlay 8 Protocol: Core and Service Providers. Intellectual Property Rights Notice for Open Specifications Documentation [MC-DPL8CS]: Intellectual Property Rights Notice for Open Specifications Documentation Technical Documentation. Microsoft publishes Open Specifications documentation ( this documentation ) for protocols,

More information

UFG-10 Family. Frame Grabbers. Easy Programming Guide. Windows

UFG-10 Family. Frame Grabbers. Easy Programming Guide. Windows UFG-10 Family Frame Grabbers Easy Programming Guide Windows Introduction Copyright This manual, Copyright 2014 Unigraf Oy. All rights reserved Reproduction of this manual in whole or in part without written

More information

Detecting USB Device Insertion and Removal Using Windows API

Detecting USB Device Insertion and Removal Using Windows API Written by Tom Bell Detecting USB Device Insertion and Removal Using Windows API When I needed to know how to detect USB device insertion and removal, I was developing an application for backing up USB

More information

LSN 4 GUI Programming Using The WIN32 API

LSN 4 GUI Programming Using The WIN32 API LSN 4 GUI Programming Using The WIN32 API ECT362 Operating Systems Department of Engineering Technology LSN 4 Why program GUIs? This application will help introduce you to using the Win32 API Gain familiarity

More information

Call DLL from Limnor Applications

Call DLL from Limnor Applications Call DLL from Limnor Applications There is a lot of computer software in the format of dynamic link libraries (DLL). DLLCaller performer allows your applications to call DLL functions directly. Here we

More information

Dotstack Porting Guide.

Dotstack Porting Guide. dotstack TM Dotstack Porting Guide. dotstack Bluetooth stack is a C library and several external interfaces that needs to be implemented in the integration layer to run the stack on a concrete platform.

More information

QCOM Reference Guide

QCOM Reference Guide QCOM Reference Guide Lars Wirfelt 2002 06 10 Copyright 2005 2016 SSAB EMEA AB Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License,

More information

SIMATIC Industrial software Readme SIMATIC S7-PLCSIM Advanced V2.0 SP1 Readme

SIMATIC Industrial software Readme SIMATIC S7-PLCSIM Advanced V2.0 SP1 Readme SIMATIC Industrial software Readme General information Content This Readme file contains information about SIMATIC S7-PLCSIM Advanced V2.0 SP1. The information should be considered more up-to-date than

More information

CS11 C++ DGC. Spring Lecture 6

CS11 C++ DGC. Spring Lecture 6 CS11 C++ DGC Spring 2006-2007 Lecture 6 The Spread Toolkit A high performance, open source messaging service Provides message-based communication Point-to-point messaging Group communication (aka broadcast

More information

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSCE 463/612 Networks and Distributed Processing Spring 2018 CSCE 463/612 Networks and Distributed Processing Spring 2018 Introduction Dmitri Loguinov Texas A&M University January 23, 2018 Original slides copyright 1996-2004 J.F Kurose and K.W. Ross 1 Updates Recv

More information

/*********************************************************************

/********************************************************************* Appendix A Program Process.c This application will send X, Y, Z, and W end points to the Mx4 card using the C/C++ DLL, MX495.DLL. The functions mainly used are monitor_var, change_var, and var. The algorithm

More information

That means circular linked list is similar to the single linked list except that the last node points to the first node in the list.

That means circular linked list is similar to the single linked list except that the last node points to the first node in the list. Leaning Objective: In this Module you will be learning the following: Circular Linked Lists and it operations Introduction: Circular linked list is a sequence of elements in which every element has link

More information

uvi ... Universal Validator Interface Software Developers Kit Revision /29/04 Happ Controls

uvi ... Universal Validator Interface Software Developers Kit Revision /29/04 Happ Controls Happ Controls 106 Garlisch Drive Elk Grove, IL 60007 Tel: 888-289-4277 / 847-593-6130 Fax: 847-593-6137 www.happcontrols.com uvi Universal Validator Interface Software Developers Kit.......... Revision

More information

Outline. Option Types. Socket Options SWE 545. Socket Options. Out-of-Band Data. Advanced Socket. Many socket options are Boolean flags

Outline. Option Types. Socket Options SWE 545. Socket Options. Out-of-Band Data. Advanced Socket. Many socket options are Boolean flags Outline SWE 545 Socket Options POSIX name/address conversion Out-of-Band Data Advanced Socket Programming 2 Socket Options Various attributes that are used to determine the behavior of sockets Setting

More information

Final Exam Solutions May 11, 2012 CS162 Operating Systems

Final Exam Solutions May 11, 2012 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2012 Anthony D. Joseph and Ion Stoica Final Exam May 11, 2012 CS162 Operating Systems Your Name: SID AND

More information

Appendix A Pseudocode of the wlan_mac Process Model in OPNET

Appendix A Pseudocode of the wlan_mac Process Model in OPNET Appendix A Pseudocode of the wlan_mac Process Model in OPNET static void wlan_frame_transmit () { char msg_string [120]; char msg_string1 [120]; WlanT_Hld_List_Elem* hld_ptr; const WlanT_Data_Header_Fields*

More information

Windows Programming. 1 st Week, 2011

Windows Programming. 1 st Week, 2011 Windows Programming 1 st Week, 2011 시작하기 Visual Studio 2008 새프로젝트 파일 새로만들기 프로젝트 Visual C++ 프로젝트 Win32 프로젝트 빈프로젝트 응용프로그램설정 Prac01 솔루션 새항목추가 C++ 파일 main.cpp main0.cpp cpp 다운로드 솔루션빌드 오류 Unicode vs. Multi-Byte

More information

[MC-DPL4R]: DirectPlay 4 Protocol: Reliable

[MC-DPL4R]: DirectPlay 4 Protocol: Reliable [MC-DPL4R]: DirectPlay 4 Protocol: Reliable Intellectual Property Rights Notice for Open Specifications Documentation Technical Documentation. Microsoft publishes Open Specifications documentation for

More information

Operating Systems 2010/2011

Operating Systems 2010/2011 Operating Systems 2010/2011 Signals Johan Lukkien 1 Signals A signal is a software generated event notification of state change encapsulation of physical event usually: sent from a process to a process

More information

Windows and Messages. Creating the Window

Windows and Messages. Creating the Window Windows and Messages In the first two chapters, the sample programs used the MessageBox function to deliver text output to the user. The MessageBox function creates a "window." In Windows, the word "window"

More information

MOBILE COMPUTING Practical 1: Graphic representation

MOBILE COMPUTING Practical 1: Graphic representation MOBILE COMPUTING Practical 1: Graphic representation Steps 2) Then in class view select the Global, in global select the WINMAIN. 3) Then write the below code below #define MAX_LOADSTRING 100 enum Shapes

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

CSCE : Computer Systems Homework #1 Part 1 (25 pts) Due date: 1/24/19

CSCE : Computer Systems Homework #1 Part 1 (25 pts) Due date: 1/24/19 1. Purpose CSCE 313-200: Computer Systems Homework #1 Part 1 (25 pts) Due date: 1/24/19 Understand the Visual Studio environment, creation of projects, simple process debugging, search algorithms, and

More information

Window programming. Programming

Window programming. Programming Window programming 1 Objectives Understand the mechanism of window programming Understand the concept and usage of of callback functions Create a simple application 2 Overview Windows system Hello world!

More information

Socket I/Os in Windows. Dae-Ki Kang

Socket I/Os in Windows. Dae-Ki Kang Socket I/Os in Windows Dae-Ki Kang Agenda TCP Server/Client Multi-Threads Synchronization Socket IO Model WSAAsyncSelect Model WSAEventSelect Model UDP Server/Client Overlapped Model Completion Port Model

More information

Stream Server SDK Programmer s Manual V2.0. Stream Server SDK Programmer s Manual V 2.0

Stream Server SDK Programmer s Manual V2.0. Stream Server SDK Programmer s Manual V 2.0 Stream Server SDK Programmer s Manual V 2.0 Index 1. Summary... 1 2. Stream Server System SDK... 2 2.1 Stream Media Server SDK... 2 2.2 Stream Client SDK... 4 2.2.1 DLL Interface... 4 2.2.2 Callback Function

More information

Today we spend some time in OO Programming (Object Oriented). Hope you did already work with the first Starter and the box at:

Today we spend some time in OO Programming (Object Oriented). Hope you did already work with the first Starter and the box at: maxbox Starter 2 Start with OO Programming 1.1 First Step Today we spend some time in OO Programming (Object Oriented). Hope you did already work with the first Starter and the box at: http://www.softwareschule.ch/download/maxbox_starter.pdf

More information

File System Watcher. Gregory Adam 2015

File System Watcher. Gregory Adam 2015 File System Watcher Gregory Adam 2015 Le minerai de fer peut croire qu'il est torturé sans raison dans la fournaise, mais lorsque la lame de l'acier le plus fin réfléchit à cette torture, elle en comprend

More information

Hands-On Lab. Multitouch Gestures - Native. Lab version: Last updated: 12/3/2010

Hands-On Lab. Multitouch Gestures - Native. Lab version: Last updated: 12/3/2010 Hands-On Lab Multitouch Gestures - Native Lab version: 1.0.0 Last updated: 12/3/2010 CONTENTS OVERVIEW... 3 EXERCISE 1: BUILD A MULTITOUCH APPLICATION... 7 Task 1 Create the Win32 Application... 7 Task

More information

CUDA Toolkit CUPTI User's Guide. DA _v01 September 2012

CUDA Toolkit CUPTI User's Guide. DA _v01 September 2012 CUDA Toolkit CUPTI User's Guide DA-05679-001_v01 September 2012 Document Change History Ver Date Resp Reason for change v01 2011/1/19 DG Initial revision for CUDA Tools SDK 4.0 v02 2012/1/5 DG Revisions

More information

Processes COMPSCI 386

Processes COMPSCI 386 Processes COMPSCI 386 Elements of a Process A process is a program in execution. Distinct processes may be created from the same program, but they are separate execution sequences. call stack heap STACK

More information

dotstack integration with STM32F4 & FreeRTOS.

dotstack integration with STM32F4 & FreeRTOS. dotstack TM dotstack integration with STM32F4 & FreeRTOS. Contents 1. Bluetooth Task... 3 2. Bluetooth controller UART driver... 4 3. Audio playback and recording... 6 3.1. Audio playback... 7 3.2. Audio

More information

Hands-On Lab. Multi-Touch WMTouch - Native. Lab version: Last updated: 12/3/2010

Hands-On Lab. Multi-Touch WMTouch - Native. Lab version: Last updated: 12/3/2010 Hands-On Lab Multi-Touch WMTouch - Native Lab version: 1.0.0 Last updated: 12/3/2010 CONTENTS OVERVIEW... 3 EXERCISE 1: BUILD A MULTI-TOUCH APPLICATION... 5 Task 1 Create the Win32 Application... 5 Task

More information

Asynchronous Events on Linux

Asynchronous Events on Linux Asynchronous Events on Linux Frederic.Rossi@Ericsson.CA Open System Lab Systems Research June 25, 2002 Ericsson Research Canada Introduction Linux performs well as a general purpose OS but doesn t satisfy

More information

µtasker Document µtasker MQTT/MQTTS

µtasker Document µtasker MQTT/MQTTS Embedding it better... µtasker Document /MQTTS utasker_mqtt.doc/v1.00 Copyright 2018 M.J.Butcher Consulting Table of Contents 1. Introduction...3 2. Enabling MQTT...4 3. MQTT Operation and Interface...5

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 8: Semaphores, Monitors, & Condition Variables

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 8: Semaphores, Monitors, & Condition Variables CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004 Lecture 8: Semaphores, Monitors, & Condition Variables 8.0 Main Points: Definition of semaphores Example of use

More information

How to write a vjoy Feeder

How to write a vjoy Feeder Software Reference Interface Functions General Driver Data Device Information Device Feeding Force Feedback Interface Structures Interface Constants Interface Function Pointers How to write a vjoy Feeder

More information

Chapter 15 Programming Paradigm

Chapter 15 Programming Paradigm Chapter 15 Programming Paradigm A Windows program, like any other interactive program, is for the most part inputdriven. However, the input of a Windows program is conveniently predigested by the operating

More information

#include <tobii/tobii.h> char const* tobii_error_message( tobii_error_t error );

#include <tobii/tobii.h> char const* tobii_error_message( tobii_error_t error ); tobii.h Thread safety The tobii.h header file collects the core API functions of stream engine. It contains functions to initialize the API and establish a connection to a tracker, as well as enumerating

More information

Comparing Touch Coding Techniques - Windows 8 Desktop Touch Sample

Comparing Touch Coding Techniques - Windows 8 Desktop Touch Sample Comparing Touch Coding Techniques - Windows 8 Desktop Touch Sample Abstract There are three ways to support touch input and gestures in Microsoft Windows 8* Desktop apps: Using the WM_POINTER, WM_GESTURE,

More information

DLL User's Guide for the AlphiDll

DLL User's Guide for the AlphiDll DLL User's Guide for the AlphiDll SOFTWARE REFERENCE 745-06-002-4000 Revision G 01/22/01 Copyright 1999-2001 ALPHI Technology Corp. ALPHI Technology Corp. 6202 S. Maple Ave., #120 Tempe, AZ 85283 Tel:

More information

The User Datagram Protocol

The User Datagram Protocol The User Datagram Protocol Stefan D. Bruda Winter 2018 UDP Very similar to the TCP in terms of API Dissimilar with TCP in terms of innards (and hence programming techniques) Many-to-many communication.

More information

Basic DOF Security. Programmer s Guide. Version 7.0

Basic DOF Security. Programmer s Guide. Version 7.0 Basic DOF Security Programmer s Guide Version 7.0 Table of Contents Chapter 1: Introduction 1 How to Read This Guide 1 Security Concepts Overview 1 Roles 2 Chapter 2: Authentication Server Access 3 Installing

More information

Cisco TSP Media Driver

Cisco TSP Media Driver Cisco Media Driver introduces a new and innovative way for TAPI-based applications to provide media interaction such as play announcements, record calls, and so on. Cisco TSP 8.0(1) includes support for

More information

Cisco TSP Media Driver

Cisco TSP Media Driver Cisco Media Driver introduces a new and innovative way for TAPI-based applications to provide media interaction such as play announcements, record calls, and so on. Cisco TSP 8.0(1) includes support for

More information

Input and Interaction

Input and Interaction Input and Interaction 5 th Week, 2011 Graphical Input Devices Mouse Trackball Light Pen Data Tablet Joy Stick Space Ball Input Modes Input devices contain a trigger which can be used to send a signal to

More information

CS410 Visual Programming Solved Online Quiz No. 01, 02, 03 and 04. For Final Term Exam Preparation by Virtualians Social Network

CS410 Visual Programming Solved Online Quiz No. 01, 02, 03 and 04. For Final Term Exam Preparation by Virtualians Social Network CS410 Visual Programming Solved Online Quiz No. 01, 02, 03 and 04 For Final Term Exam Preparation by Virtualians Social Network 1. Ptr -> age is equivalent to *ptr.age ptr.age (ptr).age (*ptr).age 2. is

More information

Interprocess Communication

Interprocess Communication Interprocess Communication Nicola Dragoni Embedded Systems Engineering DTU Informatics 4.2 Characteristics, Sockets, Client-Server Communication: UDP vs TCP 4.4 Group (Multicast) Communication The Characteristics

More information

CS 160: Interactive Programming

CS 160: Interactive Programming CS 160: Interactive Programming Professor John Canny 3/8/2006 1 Outline Callbacks and Delegates Multi-threaded programming Model-view controller 3/8/2006 2 Callbacks Your code Myclass data method1 method2

More information

UDP CONNECT TO A SERVER

UDP CONNECT TO A SERVER UDP The User Datagram Protocol Stefan D. Bruda Winter 2018 Very similar to the TCP in terms of API Dissimilar with TCP in terms of innards (and hence programming techniques) Many-to-many communication.

More information

CSci 4061 Introduction to Operating Systems. (Advanced Control Signals)

CSci 4061 Introduction to Operating Systems. (Advanced Control Signals) CSci 4061 Introduction to Operating Systems (Advanced Control Signals) What is a Signal? Signals are a form of asynchronous IPC Earlier: Non-blocking I/O and check if it has happened => polling Problem

More information

softmc Servotronix Motion API Reference Manual Revision 1.0

softmc Servotronix Motion API Reference Manual Revision 1.0 Servotronix Motion API Reference Manual Revision 1.0 Revision History Document Revision Date 1.0 Nov. 2014 Initial release Copyright Notice Disclaimer Trademarks 2014 Servotronix Motion Control Ltd. All

More information

Programming with the Service Control Engine Subscriber Application Programming Interface

Programming with the Service Control Engine Subscriber Application Programming Interface CHAPTER 5 Programming with the Service Control Engine Subscriber Application Programming Interface Revised: July 28, 2009, Introduction This chapter provides a detailed description of the Application Programming

More information

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D) MANAGEMENT OF APPLICATION EXECUTION PROCESS CONTROL BLOCK Resources (processor, I/O devices, etc.) are made available to multiple applications The processor in particular is switched among multiple applications

More information

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C. Structure Unix architecture users Functions of the System tools (shell, editors, compilers, ) standard library System call Standard library (printf, fork, ) OS kernel: processes, memory management, file

More information

Lambda Expression & Concurrency API. 김명신부장 Principal Technical Evangelist

Lambda Expression & Concurrency API. 김명신부장 Principal Technical Evangelist Lambda Expression & Concurrency API 김명신부장 Principal Technical Evangelist 완전친절한 Lambda Expression 완전불친절한 Concurrency API 완전간단한 실천적접근 Alonzo Church [lambda-capture] { body } [lambda-capture] (params) {

More information

Crit-bit Trees. Adam Langley (Version )

Crit-bit Trees. Adam Langley (Version ) CRITBIT CWEB OUTPUT 1 Crit-bit Trees Adam Langley (agl@imperialviolet.org) (Version 20080926) 1. Introduction This code is taken from Dan Bernstein s qhasm and implements a binary crit-bit (alsa known

More information

Suggested Solutions (Midterm Exam October 27, 2005)

Suggested Solutions (Midterm Exam October 27, 2005) Suggested Solutions (Midterm Exam October 27, 2005) 1 Short Questions (4 points) Answer the following questions (True or False). Use exactly one sentence to describe why you choose your answer. Without

More information

Developer Documentation

Developer Documentation Developer Documentation Development of Scanner Applications for ACD Windows CE Second Edition Devices Version: 3.0 Copyright ACD Gruppe This document may not be duplicated or made accessible to third parties

More information

SOCKETLIB. Requirements

SOCKETLIB. Requirements SOCKETLIB SocketLib is an event based, semi-asynchronous socket stream. It derives from standard C++ sockets, therefore, all extractors (>>) and inserters (

More information

Compiling Your Code and Running the Tests

Compiling Your Code and Running the Tests Database Systems Instructor: Hao-Hua Chu Fall Semester, 2004 Assignment 4: Heap File Page Structure Deadline: 17:00, October 26 (Tuesday), 2004 This is a group assignment, and at most 2 people per group

More information

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory Socket Programming Sungkyunkwan University Hyunseung Choo choo@skku.edu Copyright 2000-2019 Networking Laboratory Contents Goals Client-Server mechanism Introduction to socket Programming with socket on

More information

Playing & Recording Audio Audio Queue Services Playback

Playing & Recording Audio Audio Queue Services Playback Playing & Recording Audio Audio Queue Services Playback The most common scenario : basic playing back an on-disk file 11 2010-2 iphone Application 1. 2. Playback Audio Queue Callback 1. Playback Audio

More information

Internet II. CS10 : Beauty and Joy of Computing. cs10.berkeley.edu. !!Senior Lecturer SOE Dan Garcia!!! Garcia UCB!

Internet II. CS10 : Beauty and Joy of Computing. cs10.berkeley.edu. !!Senior Lecturer SOE Dan Garcia!!!  Garcia UCB! cs10.berkeley.edu CS10 : Beauty and Joy of Computing Internet II!!Senior Lecturer SOE Dan Garcia!!!www.cs.berkeley.edu/~ddgarcia CS10 L17 Internet II (1)! Why Networks?! Originally sharing I/O devices

More information

Advantech Windows CE.net Application Hand on Lab

Advantech Windows CE.net Application Hand on Lab Advantech Windows CE.net Application Hand on Lab Lab : Serial Port Communication Objectives After completing this lab, you will be able to: Create an application to open, initialize the serial port, and

More information

5X80 Series. Software Development Kit (SDK) for 5080, 5180, and 5380 Decoded Miniature Image Scan Engines. User s Guide

5X80 Series. Software Development Kit (SDK) for 5080, 5180, and 5380 Decoded Miniature Image Scan Engines. User s Guide 5X80 Series Software Development Kit (SDK for 5080, 5180, and 5380 Decoded Miniature Image Scan Engines User s Guide Disclaimer Honeywell International Inc. ( HII reserves the right to make changes in

More information

Networking, Java threads and synchronization. PRIS lecture 4 Fredrik Kilander

Networking, Java threads and synchronization. PRIS lecture 4 Fredrik Kilander Networking, Java threads and synchronization PRIS lecture 4 Fredrik Kilander OSI Application Presentation Session Transport Network Data link Physical TCP/IP Application Transport Internet Host-to-network

More information

Object-Interaction Diagrams: Sequence Diagrams UML

Object-Interaction Diagrams: Sequence Diagrams UML Object-Interaction Diagrams: Sequence Diagrams UML Communication and Time In communication diagrams, ordering of messages is achieved by labelling them with sequence numbers This does not make temporal

More information

DirectX Programming Introduction

DirectX Programming Introduction DirectX Programming Introduction DirectX is implemented as a collection of COM objects To use a DirectX program, the user must have the correct (or later) version of DirectX installed (e.g. by doing Windows

More information

Lecture 8: Other IPC Mechanisms. CSC 469H1F Fall 2006 Angela Demke Brown

Lecture 8: Other IPC Mechanisms. CSC 469H1F Fall 2006 Angela Demke Brown Lecture 8: Other IPC Mechanisms CSC 469H1F Fall 2006 Angela Demke Brown Topics Messages through sockets / pipes Receiving notification of activity Generalizing the event notification mechanism Kqueue Semaphores

More information

Topics. Lecture 8: Other IPC Mechanisms. Socket IPC. Unix Communication

Topics. Lecture 8: Other IPC Mechanisms. Socket IPC. Unix Communication Topics Lecture 8: Other IPC Mechanisms CSC 469H1F Fall 2006 Angela Demke Brown Messages through sockets / pipes Receiving notification of activity Generalizing the event notification mechanism Kqueue Semaphores

More information

The Modification and Implementation of Campus Network Client. Lingfang Huanga

The Modification and Implementation of Campus Network Client. Lingfang Huanga 4th International Conference on Mechatronics, Materials, Chemistry and Computer Engineering (ICMMCCE 2015) The Modification and Implementation of Campus Network Client Lingfang Huanga Institute of Mathematics

More information

TCP and Concurrency. The third assignment at DA

TCP and Concurrency. The third assignment at DA TCP and Concurrency The third assignment at DA2402 2009-03-05 Jonas Lundberg/Ola Flygt adapted to Java by Marcus Edvinsson maintained by Marcus Edvinsson Matematiska och systemtekniska institutionen, MSI

More information

CA Data Protection. External Agent COM API Reference Guide. Release 15.0

CA Data Protection. External Agent COM API Reference Guide. Release 15.0 CA Data Protection External Agent COM API Reference Guide Release 15.0 This Documentation, which includes embedded help systems and electronically distributed materials (hereinafter referred to as the

More information

Ethernet Industrial I/O Modules API and Programming Guide Model 24xx Family Rev.A August 2010

Ethernet Industrial I/O Modules API and Programming Guide Model 24xx Family Rev.A August 2010 Ethernet Industrial I/O Modules API and Programming Guide Model 24xx Family Rev.A August 2010 Designed and manufactured in the U.S.A. SENSORAY p. 503.684.8005 email: info@sensoray.com www.sensoray.com

More information

Programming with the Service Control Engine Subscriber Application Programming Interface

Programming with the Service Control Engine Subscriber Application Programming Interface CHAPTER 5 Programming with the Service Control Engine Subscriber Application Programming Interface Revised: November 20, 2012, Introduction This chapter provides a detailed description of the Application

More information

Interactive Graphical Systems HT2006

Interactive Graphical Systems HT2006 HT2006 Networked Virtual Environments Informationsteknologi 2006-09-26 #1 This Lecture Background and history on Networked VEs Fundamentals (TCP/IP, etc) Background and history on Learning NVEs Demo of

More information

6 System Processes Keyboard Command Decoder CRT Display... 26

6 System Processes Keyboard Command Decoder CRT Display... 26 Contents 1 INTRODUCTION 5 2 GLOBAL INFORMATION 6 2.1 Process States................................... 6 2.2 Message Types.................................. 6 2.3 Kernel Control Structure.............................

More information

SpiNNaker Application Programming Interface (API)

SpiNNaker Application Programming Interface (API) SpiNNaker Application Programming Interface (API) Version 2.0.0 10 March 2016 Application programming interface (API) Event-driven programming model The SpiNNaker API programming model is a simple, event-driven

More information

COMMON-ISDN-API. Version 2.0. Part II. 4 th Edition. Operating Systems

COMMON-ISDN-API. Version 2.0. Part II. 4 th Edition. Operating Systems COMMON-ISDN-API Version 2.0 Part II Operating Systems 4 th Edition June 2001 Author: CAPI Association e.v. All rights reserved Editor: AVM GmbH, Germany E-mail: hj.ortmann@avm.de 4th Edition / June 2001

More information

CALIFORNIA SOFTWARE LABS

CALIFORNIA SOFTWARE LABS Blocking TCP requests on an Ethernet Network for Bandwidth Control CALIFORNIA SOFTWARE LABS R E A L I Z E Y O U R I D E A S California Software Labs 6800 Koll Center Parkway, Suite 100 Pleasanton CA 94566,

More information

CSC209H Lecture 11. Dan Zingaro. March 25, 2015

CSC209H Lecture 11. Dan Zingaro. March 25, 2015 CSC209H Lecture 11 Dan Zingaro March 25, 2015 Level- and Edge-Triggering (Kerrisk 63.1.1) When is an FD ready? Two answers: Level-triggered: when an operation will not block (e.g. read will not block),

More information

libnetfilter_log Reference Manual

libnetfilter_log Reference Manual libnetfilter_log Reference Manual x.y Generated by Doxygen 1.4.6 Tue Mar 21 13:47:12 2006 CONTENTS 1 Contents 1 libnetfilter_log File Index 1 2 libnetfilter_log File Documentation 1 1 libnetfilter_log

More information

Name: uteid: 1. CS439H: Fall 2011 Midterm 1

Name: uteid: 1. CS439H: Fall 2011 Midterm 1 Name: uteid: 1 Instructions CS439H: Fall 2011 Midterm 1 Stop writing when time is announced at the end of the exam. I will leave the room as soon as I ve given people a fair chance to bring me the exams.

More information

Operating System Structure

Operating System Structure Operating System Structure CSCI 4061 Introduction to Operating Systems Applications Instructor: Abhishek Chandra Operating System Hardware 2 Questions Operating System Structure How does the OS manage

More information

Overview. Administrative. * HW 1 grades. * HW 2 Due. Topics. * 5.1 What is a Signal? * Dealing with Signals - masks, handlers

Overview. Administrative. * HW 1 grades. * HW 2 Due. Topics. * 5.1 What is a Signal? * Dealing with Signals - masks, handlers Overview Administrative * HW 1 grades * HW 2 Due Topics * 5.1 What is a Signal? * 5.2-3 Dealing with Signals - masks, handlers * 5.4 Synchronization: pause(), sigsuspend() * 5.6 Interaction with other

More information

Project-2 Continued. Subhojeet Mukherjee CSU Database and Security Research Group

Project-2 Continued. Subhojeet Mukherjee CSU Database and Security Research Group Project-2 Continued Subhojeet Mukherjee CSU Database and Security Research Group Storyboard IP: 129.82.34.24 IP: 129.62.14.90 IP: 219.65.74.90 IP: 219.62.21.91 I know what you did last summer from this

More information

CS 167 Final Exam Solutions

CS 167 Final Exam Solutions CS 167 Final Exam Solutions Spring 2018 Do all questions. 1. [20%] This question concerns a system employing a single (single-core) processor running a Unix-like operating system, in which interrupts are

More information

Memory Based Driver PTC Inc. All Rights Reserved.

Memory Based Driver PTC Inc. All Rights Reserved. 2017 PTC Inc. All Rights Reserved. 2 Table of Contents Memory Based Driver 1 Table of Contents 2 Memory Based Driver 3 Overview 3 Channel Properties - General 3 Channel Properties - Write Optimizations

More information

Lab 2: Implementing a Reliable Transport Protocol (30 points)

Lab 2: Implementing a Reliable Transport Protocol (30 points) Lab 2: Implementing a Reliable Transport Protocol (30 points) Overview In this laboratory programming assignment, you will be writing the sending and receiving transport-level code for implementing a simple

More information

Multithreaded Programming

Multithreaded Programming Multithreaded Programming The slides do not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. September 4, 2014 Topics Overview

More information

DSP/BIOS LINK. Configurable TSK and SWI approach LNK 207 DES. Version <1.00>

DSP/BIOS LINK. Configurable TSK and SWI approach LNK 207 DES. Version <1.00> DESIGN DOCUMENT DSP/BIOS LINK Version Template Version 12 Version Page 1 of 21 This page has been intentionally left blank Version Page 2 of 21 IMPORTANT NOTICE Texas Instruments Incorporated

More information

OPC DA Client Driver PTC Inc. All Rights Reserved.

OPC DA Client Driver PTC Inc. All Rights Reserved. 2017 PTC Inc. All Rights Reserved. 2 Table of Contents 1 Table of Contents 2 4 Overview 4 OPC Compliance 5 Project Architecture 5 Channel Properties General 6 Channel Properties Write Optimizations 6 Channel

More information

CSC369 Lecture 2. Larry Zhang

CSC369 Lecture 2. Larry Zhang CSC369 Lecture 2 Larry Zhang 1 Announcements Lecture slides Midterm timing issue Assignment 1 will be out soon! Start early, and ask questions. We will have bonus for groups that finish early. 2 Assignment

More information

ANKARA UNIVERSITY COMPUTER ENGINEERING DEPARTMENT BLM334-COM334 PROJECT

ANKARA UNIVERSITY COMPUTER ENGINEERING DEPARTMENT BLM334-COM334 PROJECT ANKARA UNIVERSITY COMPUTER ENGINEERING DEPARTMENT BLM334-COM334 PROJECT Due date: 08.05.2013 Lab Hours You re expected to implement Producer-Consumer Problem that is described below. (Any form of cheating

More information