Jazz Soft Contact us?   JazzSoft@live.com     English   English  Japanese  Chinese (Traditional)  Chinese (Simlified)
Factory Automation & Yield Management Solution Provider 
Skip Navigation LinksHome > Products > Savoy > Savoy Socket Reference > Properties > MyPortNumber

Savoy Socket Reference   

Properties
Appearance
BorderStyle
Connect
IniFileName
IniSection
IPAddress
MyPortNumber
PortNumber
Server

Methods
AboutBox
Disconnect
LoadIniFile
Send
Setup

Events
Connected
Disconnected
Problem
Received

MyPortNumber Property

Gets or sets local portnumber for TCP/IP connection. If SavoySocket is running as client, this property should be 0. Or connection will not be re-established until TCP/IP level time-out.

When SavoySocket is running as server, MyPortNumber property indicates server port number for incoming client connection.

Since some port numbers are reserved by Windows OS, the number should be grater than 1024 in general. For example http server uses port number 80.

Syntax

Visual Basic

MyPortNumber As Long


Visual C++

long GetMyPortNumber()
void SetMyPortNumber(long)

Return Value

Example

Visual Basic

.IPAddress = "my_server"
.PortNumber = 5000
.MyPortNumber = 0
.Server = False
.Connect = True ' Open
If Not .Connect then
  MsgBox "Cannot connect to server!"
End If


Visual C++

m_ctrl.SetIPAddress("my_server");
m_ctrl.SetPortNumber(5000);
m_ctrl.SetLocalPortNumber(0);
m_ctrl.SetServer(false);
m_ctrl.SetConnect(true); // Open
if(!m_ctrl.GetConnect())
  MessageBox("Cannot connect to server!");

Remarks

Persistent property.

See Also

Contact us?   JazzSoft@live.com
  Copyright © 1997 - 2018 Jazz Soft, Inc.