15,888,340 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10080434 (Top 2 by date)
Member 10080434
10-Jul-13 0:49am
View
Thanks for reply and given interest in my post. i am doing based on event and i am using callback concept of wcf. it is working.
but i am getting now one problem that is, i want to do communication on udp protocol in wcf.
and i don't know properly custom binding. i have also gone through UDP transport article given by microsoft --> http://msdn.microsoft.com/en-us/library/ms751494.aspx.
i did program for server like this.
i have added reference of udptransport dll.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using Microsoft.Samples.Udp;
namespace udponwcf
{
[ServiceContract]
public interface IUpdatePlayerInfoContract
{
[OperationContract(IsOneWay = true)]
void Update(byte playerID, byte locationX, byte locationY);
}
class playerInfoService : IUpdatePlayerInfoContract
{
public void Update(byte playerID, byte locationX, byte locationY)
{
Console.WriteLine(playerID+""+ locationX+""+ locationY);
}
}
class Program
{
static void servicefromcode()
{
BindingElementCollection bindingElements = new BindingElementCollection();
ReliableSessionBindingElement session = new ReliableSessionBindingElement();
session.Ordered = true;
bindingElements.Add(session);
bindingElements.Add(new CompositeDuplexBindingElement());
bindingElements.Add(transport)
Binding playerInfoBinding = new CustomBinding(bindingElements);
Uri playerInfoAddress = new Uri("soap.udp://192.168.72.157:16000/");
using (ServiceHost service = new ServiceHost(typeof(playerInfoService)))
{
service.AddServiceEndpoint(typeof(IUpdatePlayerInfoContract), playerInfoBinding, playerInfoAddress);
service.Open();
}
}
static void Main(string[] args)
{
servicefromcode();
}
}
}
but when i am running this program, i am getting exception
(The CustomBinding on the ServiceEndpoint with contract 'IUpdatePlayerInfoContract' lacks a TransportBindingElement. Every binding must have at least one binding element that derives from TransportBindingElement.)
Please tell me how i can solve this problem. Thank's for given interest in my post.
Member 10080434
31-May-13 8:17am
View
Sir please share Connectivity with jquery and wcf by which i can do. i am trying but yet not done.