• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetPort函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了GetPort函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PUSH_SERVER_ERROR

BOOL CPushServer::Start()
{
    m_pServer->DoAccept.connect(&m_handler, &CPushServerHandler::OnAccept);
    m_pServer->DoClose.connect(&m_handler, &CPushServerHandler::OnClose);
    
    if (m_pServer->Bind(GetListenIP().c_str(), GetPort()) == FALSE)
    {
        PUSH_SERVER_ERROR("push server bind failed, ip: %s, port: %u.", GetListenIP().c_str(),
                          GetPort());
        return FALSE;
    }
    
    m_pServer->Listen();
    PUSH_SERVER_DEBUG("push server start successed, ip: %s, port: %u.", GetListenIP().c_str(),
                      GetPort());
    return TRUE;
}
开发者ID:0359xiaodong,项目名称:TeamTalk,代码行数:17,代码来源:push_server.cpp


示例2: device_dialog_filter_proc

static pascal Boolean device_dialog_filter_proc(
	DialogPtr dialog,
	EventRecord *event,
	short *item_hit)
{
	GrafPtr old_port;
	short item_type;
	Handle item_handle;
	Rect item_rectangle;
	boolean handled= FALSE;

	GetPort(&old_port);
	SetPort(dialog);
	
	GetDItem(dialog, iDEVICE_AREA, &item_type, &item_handle, &item_rectangle);

	/* preprocess events */	
	switch(event->what)
	{
		case mouseDown:
		{
			Point where= event->where;
			
			GlobalToLocal(&where);
			switch (FindDItem(dialog, where)+1)
			{
				case iDEVICE_AREA:
				{
					GDHandle new_device= click_in_device_area(&device_dialog_globals.device_spec, &item_rectangle, where);
					
					if (new_device && new_device!=device_dialog_globals.device)
					{
						device_dialog_globals.device= new_device;
						BuildExplicitGDSpec(&device_dialog_globals.device_spec, new_device, device_dialog_globals.device_spec.flags, device_dialog_globals.device_spec.bit_depth, 0, 0);
						draw_device_area(&device_dialog_globals.device_spec, device_dialog_globals.device, &item_rectangle);
						
						*item_hit= iDEVICE_AREA;
					}
					handled= TRUE;
					
					break;
				}
			}
			break;
		}
		
		case updateEvt:
			if ((DialogPtr)event->message==dialog)
			{
				draw_device_area(&device_dialog_globals.device_spec, device_dialog_globals.device, &item_rectangle);
			}
			break;
	}

	SetPort(old_port);

	return handled ? TRUE : general_filter_proc(dialog, event, item_hit);
}
开发者ID:DrItanium,项目名称:moo,代码行数:58,代码来源:device_dialog.c


示例3: GetPort

void BURGER_API Burger::OkAlertMessage(const char *pMessage,const char *pTitle)
{
	Word8 *TitleStr;		/* Pointer to the window title */
	DialogPtr MyDialog;	/* My dialog pointer */
	Handle ItemList;	/* Handle to the item list */
	Rect DialogRect;	/* Rect of the dialog window */
	Word TitleLen;		/* Length of the title */
	Word MessLen;		/* Length of the caption */
	short ItemHit;		/* Junk */
	Rect WorkRect;
	GrafPtr MyPort;	/* My grafport */
	//Word Foo;
	
	//Foo = InputSetState(FALSE);
		
	GetPort(&MyPort);	/* Save the current port */
	
	/* Center my dialog to the screen */
#if ACCESSOR_CALLS_ARE_FUNCTIONS
	GetPortBounds(MyPort,&WorkRect);
#else
	WorkRect = MyPort->portRect;
#endif
	DialogRect.top = static_cast<short>((((WorkRect.bottom-WorkRect.top)-190)/2)+WorkRect.top);
	DialogRect.left = static_cast<short>((((WorkRect.right-WorkRect.left)-350)/2)+WorkRect.left);
	DialogRect.bottom = static_cast<short>(DialogRect.top+190);
	DialogRect.right = static_cast<short>(DialogRect.left+350);

	TitleLen = 0;			/* Assume no length */
	if (pTitle) {
		TitleLen = Burger::StringLength(pTitle);		/* Get the length of the title string */
	}
	TitleStr = (Word8 *)Burger::Alloc(TitleLen+1);	/* Get memory of pascal string */
	if (TitleStr) {			/* Did I get the memory? */
		MemoryCopy(TitleStr+1,pTitle,TitleLen);
		TitleStr[0] = static_cast<Word8>(TitleLen);		/* Set the pascal length */
		
		MessLen = Burger::StringLength(pMessage);	/* Size of the message */
		ItemList = NewHandle(static_cast<Size>(sizeof(Template)+MessLen));
		if (ItemList) {				/* Ok? */
			Template[sizeof(Template)-1]=static_cast<Word8>(MessLen);	/* Save the message length */
			MemoryCopy(ItemList[0],Template,sizeof(Template));	/* Copy the template */
			MemoryCopy((ItemList[0])+sizeof(Template),pMessage,MessLen);	/* Copy the message */
			MyDialog = NewDialog(0,&DialogRect,(Word8 *)TitleStr,TRUE,5,(WindowPtr)-1,FALSE,0,ItemList);
			if (MyDialog) {
				SetDialogDefaultItem(MyDialog,1);	/* Default for OK button */
				ModalDialog(0,&ItemHit);			/* Handle the event */
				DisposeDialog(MyDialog);			/* Kill the dialog */
			} else {
				DisposeHandle(ItemList);			/* I must kill this myself! */
			}
		}
		Burger::Free(TitleStr);				/* Kill the title */
	}
	SetPort(MyPort);			/* Restore my grafport */
	//InputSetState(Foo);
}
开发者ID:Olde-Skuul,项目名称:burgerlib,代码行数:57,代码来源:brdebugmac.cpp


示例4: SetDialogPort

/*	SetDialogPort(theDialog)
	
	SetDialogPort sets the current GrafPort on Macintosh and does nothing on
	Windows.
	
	On Macintosh, it returns the current GrafPort before SetDialogPort was
	called. On Windows, it returns theDialog. This routine exists solely to avoid
	the need for an ifdef when you need to deal with the Macintosh current GrafPort
	in cross-platform dialog code. 

	Thread Safety: SetDialogPort is not thread-safe.
*/
CGrafPtr
SetDialogPort(DialogPtr theDialog)
{
	CGrafPtr savePort;
	
	GetPort(&savePort);
	SetPortDialogPort(theDialog);
	return savePort;
}
开发者ID:jgreenb2,项目名称:DFMLoadWave,代码行数:21,代码来源:XOPDialogsMac.c


示例5: HAL_UART_RxCpltCallback

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
	portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	// Give back the mutex.
	xSemaphoreGiveFromISR( PxSemaphoreHandle[GetPort(huart)], &( xHigherPriorityTaskWoken ) );
	
	UartRxReady = SET;
}
开发者ID:OUWECAD,项目名称:MOWE,代码行数:9,代码来源:stm32f0xx_it.c


示例6: main

int main(int argc, char *argv[])
{
 int rc;
 int Desc;
 int tm;
 int Port, Ip;
 char Tampon[80];

 struct sockaddr_in psoo; /* o = origine */
 struct sockaddr_in psos; /* s = serveur */
 struct sockaddr_in psor; /* r = remote */
 struct Requete UneRequete;

 memset(&psoo, 0, sizeof(struct sockaddr_in));
 memset(&psos, 0, sizeof(struct sockaddr_in));
 memset(&psor, 0, sizeof(struct sockaddr_in));

 if (argc!=5)

{
    printf("cli client portc serveur ports\n");
    exit(1);
 }
 Desc = CreateSockets(&psoo, &psos, argv[1], atoi(argv[2]), argv[3], atoi(argv[4]));
 if (Desc == -1)
    perror("CreateSockets:");
 else
    fprintf(stderr, "CreateSockets %d\n", Desc);

  Ip = GetIP(&psoo);
  Port = GetPort(&psoo);
  memset(Tampon, 0, sizeof(Tampon));
  Ipv4ToS(Ip, Tampon);
  printf("Adresse Ip du client %s : Port %d \n", Tampon, Port);

 UneRequete.Type = Question;
 strncpy(UneRequete.Message, "Multiclient; Bonjour", sizeof(UneRequete.Message));

 rc = SendDatagram(Desc, &UneRequete, sizeof(struct Requete), &psos);

 if (rc == -1)
    perror("SendDatagram");
 else
   fprintf(stderr, "Envoi de %d bytes\n", rc);

 memset(&UneRequete, 0, sizeof(struct Requete));
 tm = sizeof(struct Requete);

  rc = ReceiveDatagram(Desc, &UneRequete, tm, &psor);
 if (rc == -1)
    perror("ReceiveDatagram");
 else
   fprintf(stderr, "bytes:%d:%s\n", rc, UneRequete.Message);


 close(Desc);
}
开发者ID:bendem,项目名称:DossierReseau,代码行数:57,代码来源:cli.c


示例7: UpdateAdditionsWin

void
UpdateAdditionsWin(void)
{
	Rect		r;
	Cell		c;
	int			i;
	GrafPtr		oldPort;
	GetPort(&oldPort);
	
	SetPort(gWPtr);
	
	MoveTo( gControls->aw->compListBox.left, gControls->aw->compListBox.top - kInterWidgetPad + 1);
	HLock(gControls->cfg->selAddMsg);
	DrawString( CToPascal(*gControls->cfg->selAddMsg));
	HUnlock(gControls->cfg->selAddMsg);
	
#if 0
	RGBColor backColorOld;
    Rect adjustedRect, *clRect = &gControls->aw->compListBox;
    SetRect(&adjustedRect, clRect->left, clRect->top+1, clRect->right, clRect->bottom-1);
    GetBackColor(&backColorOld);
    BackColor(whiteColor);
    EraseRect(&adjustedRect);
    RGBBackColor(&backColorOld);
#endif
   
	LUpdate( (*gControls->aw->compList)->port->visRgn, gControls->aw->compList);
	SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top,
	            gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom);
	FrameRect(&r);	
	
	SetPt(&c, 0, 0);
	if (LGetSelect(true, &c, gControls->aw->compList))
	{
		HLock((Handle)gControls->aw->compDescTxt);
		SetRect(&r, (*gControls->aw->compDescTxt)->viewRect.left,
					(*gControls->aw->compDescTxt)->viewRect.top,
					(*gControls->aw->compDescTxt)->viewRect.right,
					(*gControls->aw->compDescTxt)->viewRect.bottom);
		HUnlock((Handle)gControls->aw->compDescTxt);
		TEUpdate(&r, gControls->aw->compDescTxt);	
	}
	
	DrawDiskSpaceMsgs( gControls->opt->vRefNum );
	
	for (i = 0; i < numRows; i++)
	{
		if (gControls->cfg->comp[rowToComp[i]].highlighted)
		{
			AddInitRowHighlight(i);
			break;
		}
	}
	
	SetPort(oldPort);
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:56,代码来源:AdditionsWin.c


示例8: LoadSettings

void WiimoteEmuGeneral::LoadSettings()
{
  auto* ce_extension = static_cast<ControllerEmu::Extension*>(
      Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Extension));

  m_extension_combo->setCurrentIndex(ce_extension->switch_extension);
  OnAttachmentChanged(ce_extension->switch_extension);

  Wiimote::LoadConfig();
}
开发者ID:OrN,项目名称:dolphin,代码行数:10,代码来源:WiimoteEmuGeneral.cpp


示例9: GetFont

void GetFont(
	TextSpec *spec)
{
	GrafPtr port;

	GetPort(&port);
	spec->font=GetPortTextFont(port);
	spec->style=GetPortTextFace(port);
	spec->size=GetPortTextSize(port);
}
开发者ID:Aleph-One-Marathon,项目名称:alephone-dingoo,代码行数:10,代码来源:csfonts.cpp


示例10: getCurrentPortBounds

void getCurrentPortBounds(Rect* inRect)
{
    /*------------------------------------------------------
        Simple utility function to get the bounds of the
        current port.
    --------------------------------------------------------*/
    CGrafPtr thePort;
    GetPort(&thePort);
    GetPortBounds(thePort,inRect);
}
开发者ID:fruitsamples,项目名称:CustomWindow,代码行数:10,代码来源:CustomWindow.c


示例11: SetHost

void CCore::ConnectToServer(CString strHost, unsigned short usPort, CString strPass)
{
	// Declare our basic network connection
	SetHost(strHost);
	SetClientPort(usPort);
	SetPass(strPass);

	// Connect to the network
	CHECK_VALID_VOID(m_pNetworkManager)
		m_pNetworkManager->Connect(GetHost(), (unsigned short) GetPort(), GetPass());
}
开发者ID:MartinJK,项目名称:IVNetwork,代码行数:11,代码来源:CCore.cpp


示例12: GetServer

	ServerOptions IrcJoinGroupChat::GetServerOptions () const
	{
		ServerOptions so;
		so.ServerName_ = GetServer ();
		so.ServerPort_ = GetPort ();
		so.ServerEncoding_ = GetEncoding ();
		so.ServerPassword_ = QString ();
		so.SSL_ = GetSSL ();
		so.ServerNickName_ = GetNickname ();
		return so;
	}
开发者ID:generatorglukoff,项目名称:leechcraft,代码行数:11,代码来源:ircjoingroupchat.cpp


示例13: IN0

void openmax_processor::emptyThisBuffer(OMX_BUFFERHEADERTYPE_p buffer, t_uint8 portNb)
//*******************************************************************************
{ //Just wrap to the base component
	IN0("\n");
	Port *pPort=GetPort(portNb);
	WARNING(pPort);
	MSG3("%s->emptyThisBuffer[%lu] Header=%p \n", GetComponentName(), buffer->nInputPortIndex, (void *)buffer);
	WARNING(buffer->nInputPortIndex==portNb);
	Component::deliverBuffer(portNb, buffer);
	OUT0("\n");
}
开发者ID:Meticulus,项目名称:vendor_st-ericsson_u8500,代码行数:11,代码来源:openmax_processor.cpp


示例14: apply_unseen_mask

void apply_unseen_mask()
{
	Rect base_rect = {9,9,53,45},to_rect,big_to = {13,13,337,265};
	GrafPtr old_port;
	short i,j,k,l;
	ConstPatternParam c;
	bool need_bother = false;
	
	if (PSD[SDF_NO_FRILLS] > 0)
		return;

	if ((is_combat()) && (which_combat_type == 0))
		return;
	if (!(is_out()) && (univ.town->lighting_type > 0))
		return;
		
	for (i = 0; i < 11; i++)
		for (j = 0; j < 11; j++) 
			if (unexplored_area[i + 1][j + 1] == 1)
				need_bother = true;
	if (need_bother == false)
		return;
				
	GetPort(&old_port);
	SetPort(terrain_screen_gworld);
	//p = *bw_pats[3];
	//c = p;
	c = *bw_pats[3];
	PenPat(c);
	PenMode(notPatOr);
	
	for (i = 0; i < 11; i++)
		for (j = 0; j < 11; j++) 
			if (unexplored_area[i + 1][j + 1] == 1) {

					to_rect = base_rect;
					OffsetRect(&to_rect,-28 + i * 28,-36 + 36 * j);
					SectRect(&to_rect,&big_to,&to_rect);
					PaintRect(&to_rect);
					//PaintRoundRect(&to_rect,4,4);
					for (k = i - 2; k < i + 1; k++)
						for (l = j - 2; l < j + 1; l++)
							if ((k >= 0) && (l >= 0) && (k < 9) && (l < 9) && ((k != i - 1) || (l != j - 1)))
								terrain_there[k][l] = -1;

				}
	
	//p = *bw_pats[6];
	//c = p;
	c = *bw_pats[6];
	PenPat(c);
	PenMode(patCopy);
	SetPort(old_port);
}
开发者ID:PBrookfield,项目名称:cboe-msvc,代码行数:54,代码来源:boe.newgraph.cpp


示例15: GetPropertyValueInt

void ShapeKeyMatrix::MakeControlsXML( QDomElement &elem, const QList<class PinItem *> &pins, const QList<PropertyValue *> &values  ) const
{
    int nRows = GetPropertyValueInt("Rows",values,0);
    int nCols = GetPropertyValueInt("Columns",values,0);

    QStringList rows, cols;
    for ( int i = 0; i < nRows; i++ )
        rows << GetPort(pins, QString("R%1").arg(i) );

    for ( int i = 0; i < nCols; i++ )
        cols << GetPort(pins, QString("C%1").arg(i) );

    MakeKeyMatrixControl( elem, 
                          GetPropertyValueString("Key Names",values,""),
                          GetPropertyValueUsagePage("Usage",values,1),
                          GetPropertyValueUsage("Usage",values,1),
                          GetPropertyValueInt("DebounceMs",values,10),
                          rows,
                          cols );
}
开发者ID:neomilium,项目名称:GenericHID,代码行数:20,代码来源:shapekeymatrix.cpp


示例16: Quartz_Locator

static Rboolean Quartz_Locator(double *x, double *y, NewDevDesc *dd)
{
    EventRecord event;
    SInt16 key;
    Boolean gotEvent;
    Boolean mouseClick = false;
    Point myPoint;
    WindowPtr window;
    SInt16 partCode;
    GrafPtr savePort;
    Cursor		arrow ;
    QuartzDesc *xd = (QuartzDesc*)dd->deviceSpecific;
	int useBeep = asLogical(GetOption(install("locatorBell"), 
						      R_NilValue));
	
    GetPort(&savePort);

    SetPortWindowPort(xd->window);
    SetThemeCursor(kThemeCrossCursor);

    while(!mouseClick) {
	
    
	gotEvent = WaitNextEvent( everyEvent, &event, 0, nil);

    CGContextFlush( GetContext(xd) );
   
	if (event.what == mouseDown) {
	    partCode = FindWindow(event.where, &window);
	    if ((window == (xd->window)) && (partCode == inContent)) {
			myPoint = event.where;
			GlobalToLocal(&myPoint);
			*x = (double)(myPoint.h);
			*y = (double)(myPoint.v);
			if(useBeep)
			 SysBeep(1);
			mouseClick = true;
	    }
	}

	if (event.what == keyDown) {
	    key = (event.message & charCodeMask);
	    if (key == 0x1b){ /* exits when the esc key is pressed */
			SetPort(savePort);
			SetThemeCursor(kThemeIBeamCursor);
			return FALSE;
	    }
	}
    }

    SetPort(savePort);
	SetThemeCursor(kThemeIBeamCursor);
    return TRUE;
}
开发者ID:Vladimir84,项目名称:rcc,代码行数:54,代码来源:devQuartz.c


示例17: sprintf

 bool HTTPServer::startPolling()
 {
     // Create and configure the server
     if ((server = mg_create_server(this, ev_handler)) == NULL) {
         return false;
     }
     char tmp_port[30];
     sprintf(tmp_port,"%s:%d", GetAddress().c_str(),GetPort());
     mg_set_option(server, "listening_port", tmp_port);
     serving_thread_func(server);
     return true;
 }
开发者ID:eiskaltdcpp,项目名称:eiskaltdcpp,代码行数:12,代码来源:jsonrpc_httpserver.cpp


示例18: MakeGlobal

/*** MAKE GLOBAL ***/
void MakeGlobal( WindowRef window, Point localPoint, Point *globalPoint )
{
	GrafPtr oldPort;
	GetPort( &oldPort );
	SetPortWindowPort( window );
	
	globalPoint->h = localPoint.h;
	globalPoint->v = localPoint.v;
	LocalToGlobal( globalPoint );

	SetPort( oldPort );
}
开发者ID:MaddTheSane,项目名称:ResKnife,代码行数:13,代码来源:Utility.cpp


示例19: MakeLocal

/*** MAKE LOCAL ***/
void MakeLocal( WindowRef window, Point globalPoint, Point *localPoint )
{
	GrafPtr oldPort;
	GetPort( &oldPort );
	SetPortWindowPort( window );
	
	localPoint->h = globalPoint.h;
	localPoint->v = globalPoint.v;
	GlobalToLocal( localPoint );

	SetPort( oldPort );
}
开发者ID:MaddTheSane,项目名称:ResKnife,代码行数:13,代码来源:Utility.cpp


示例20: GetMacWindowFromNWindow

// implementation of windows
void NCarbonWindowManager::DrawWindowContentRect(const NWindow* window, NSurface *srcSurface, const NRect & rDrawArea) const
{
	WindowRef macWindow = GetMacWindowFromNWindow(window);
	GrafPtr oldPort;

	GetPort(&oldPort);
	SetPortWindowPort(macWindow);

	srcSurface->Draw(GetWindowPort(macWindow), rDrawArea);
	
	SetPort(oldPort);
}
开发者ID:zenmumbler,项目名称:GrayBoxZ,代码行数:13,代码来源:NCarbonWindowManager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPortBool函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPoints函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap