Full Trust European Hosting

BLOG about Full Trust Hosting and Its Technology - Dedicated to European Windows Hosting Customer

WCF Hosting UK - HostForLIFE.eu :: Optional Parameters In WCF Service URI Template

clock December 21, 2018 10:09 by author Peter
WebGet(UriTemplate = "TestMessage/{p1}?firstname={firstname}&lastname={lastname}", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Xml)]  
[OperationContract]  
string TestMessage(string message, string firstname = "", string lastname = ""); 

Whereas TestMessage is my service name and p1 parameter is compulsory whereas firstname and lastname parameters are optional but u have to specify in the URI Template but keep one thing in mind while declaring the parameters as optional u have to first preceed them with ? and then parameter name and then use & to assign the second parameter as option as per your requirement. If u see in the function declaration also i have used the optional parameter feature of .Net 4.0

Step 2 - Function Definition

public string TestMessage(string message,string firstname="",string lastname="")  
{  
   string responsedata = string.Empty;   
   responsedata = message + "" + "FirstName: " + firstname + "" + "LastName: " + lastname;  
   return responsedata;  
}  

Note
How to call the Service,

Input1
http://localhost:49785/Service.svc/parameter1

Output1 - parameter1 Firstname: LastName

In the above output, only parameter1 will be returned as u didnot specify the other 2 parameters so they will get their value as "Empty"

Input2

http://localhost:49785/Service.svc/parameter1?firstname=peter&lastname=scott

Output2 - parameter1 Firstname:kamal LastName:rawat

so u will see in the above output u passed both the parameters so you got all the values.

Input2

http://localhost:49785/Service.svc/parameter1?firstname=peter

Output2 - parameter1 Firstname:kamal LastName:
In the above output parameter1 is passed i.e firstname=peter but you wont get lastname parameter, because you didn't pass and its optional if u dont pass the parameter value and will take value as empty.

HostForLIFE.eu European WCF Hosting

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



Windows Server 2016 SSD Hosting - HostForLIFE.eu :: Dedicated Server Vs VPS For Game Hosting

clock December 14, 2018 10:28 by author Peter

There are many different types of servers, each with its own strengths and use cases. Dedicated servers and virtual private servers are the most popular in the game hosting world, but which is right for you?

Both provide a complete server environment on which you can run any software, including games. From the perspective of the user, dedicated servers and virtual private servers are similar, but which you choose depends on the requirements of the games and the number of players you intend to host.

Dedicated Server

A dedicated server is a physical computer in a data center. When you run software on a dedicated server, it runs on the “bare metal”. The full resources of the physical machine are available to the user and any software they run.

Virtual Private Server

A VPS is a virtual machine. You can think of it as a simulated server running in software — a hypervisor — on a dedicated server. That makes virtual servers flexible: they can be resized or moved to a different physical server.

Server hosting providers run many virtual private servers on a single dedicated server, each of which gets a slice of the server’s resources: RAM, storage, CPU, network bandwidth. When you lease a virtual server, you choose how big that slice is.

VPS hosts often oversell virtual servers, allocating more resources than the underlying physical server has in the hope that clients won’t need all of the allotted resources at the same time. Games need all the resources they can get, so overselling can cause contention and performance issues that affect gameplay.

Dedicated servers have resource limits too, but those limits are clearly displayed when the server is leased. Server hosting providers can’t oversell dedicated servers (although they might oversell network connectivity).

How To Choose A Game Server

Most games that can be self-hosted provide guidelines about the server resources they need. Check the requirements to make sure the server you choose is capable of running the game with the number of players you expect to host.

Add-ons, modules, and expansion packs can increase the amount of RAM and storage you need, so be sure to take that into account.

Cheap VPS

A low-powered cheap virtual private server won’t cut it. Inexpensive virtual servers — think $5-$10 — allocate minimal processing power and RAM. They don’t provide the resources needed by even a simple game.

For example, Minecraft requires a minimum of 2GB of RAM. The cheapest VPS game servers provide 1GB or less. With 2 GB, a VPS can support 1 - 4 players with acceptable performance. More than five players requires 3 GB and more than 10 requires 8 GB.

High-Powered VPS

Some VPS providers offer higher-powered virtual private servers with sufficient resources to host games. They are often marketed as hybrid servers: fewer virtual servers are hosted on the same dedicated servers and each server has more resources.

Hybrid servers can provide decent performance as a moderately busy game server. They are less expensive than dedicated servers, but the prices of the most powerful hybrid servers are in-line with similarly specified dedicated servers.

Dedicated Servers

Dedicated servers offer the best game performance. They range from moderately powerful machines ideal for small personal game servers with a handful of users to the most powerful single-chassis machines available.

A top-tier dedicated server may have multiple processors with dozens of cores, hundreds of gigabytes of RAM, and several terabytes of storage. They are capable of hosting hundreds of concurrent users without breaking a sweat.

You can expect to pay under $100 per month for a low-end dedicated server more powerful and reliable than most VPS’s on the market. For a top-tier dedicated server, you will pay in excess of $1000 per month.

A Word On Networking

Network performance is just as important as server performance. The most powerful dedicated server provides a poor gaming experience if it is hosted on a high-latency network.

Most hosting providers advertise the bandwidth they provide with each server: the amount of data the client can transfer in and out of the provider’s network. That is important, but make sure that the network is also optimized for low latencies (often referred to as ping rates by gamers).

In Conclusion

Your choice of a game server should take several factors into account,

  • The resource requirements of the games you intend to host
  • The number of concurrent users
  • Your budget

Generally speaking, a dedicated server is the best solution but a high-end virtual private server might be good enough, depending on the game and the number of users.



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in